// $ANTLR 3.1.1 LPMEDParser.g 2009-10-05 23:27:27
// The variable 'variable' is assigned but its value is never used.
#pragma warning disable 168, 219
// Unreachable code detected.
#pragma warning disable 162
namespace  Core.ANTLRGrammars 
{


	using System.Collections.Generic;
	using CommonClasses.Model;
	using CommonClasses.Services;


using System;
using Antlr.Runtime;
using IList 		= System.Collections.IList;
using ArrayList 	= System.Collections.ArrayList;
using Stack 		= Antlr.Runtime.Collections.StackList;

using IDictionary	= System.Collections.IDictionary;
using Hashtable 	= System.Collections.Hashtable;


using Antlr.Runtime.Tree;

/***************************************************************
***************Base Parser for all LPMED grammars***************
***************************************************************/
public partial class LPMEDParser : Parser
{
    public static readonly string[] tokenNames = new string[] 
	{
        "<invalid>", 
		"<EOR>", 
		"<DOWN>", 
		"<UP>", 
		"CPROGRAM", 
		"CDEVICE", 
		"CTYPE", 
		"CBLOCK", 
		"CSTATEMENT", 
		"CIFTE", 
		"CASSIGN", 
		"CWHILE", 
		"CFOR", 
		"CFORDEC", 
		"CUNARMIN", 
		"CMETHODNAME", 
		"CCALL", 
		"CINT", 
		"CFLOAT", 
		"CBOOL", 
		"CSYNCCALL", 
		"CASYNCCALL", 
		"CWAITTHECALL", 
		"CWAITANYCALL", 
		"CENDTHECALL", 
		"OBJECTNAME", 
		"MEMBERNAME", 
		"NODES", 
		"CGETSTATE", 
		"CBREAKPOINT", 
		"CREGMETHACCESS", 
		"CREGFUNCACCESS", 
		"CTERMINATEALL", 
		"CASYNCFUNCCALL", 
		"CSYNCFUNCCALL", 
		"CWAITFUNCFINISH", 
		"CDEFUN", 
		"PARAMS", 
		"PARAM", 
		"TERMINATEALL", 
		"OpIncDec", 
		"OpNegation", 
		"OpUnar", 
		"OpDivMul", 
		"OpAddSub", 
		"OpLogicalA", 
		"OpLogicalB", 
		"OpAnd", 
		"OpOr", 
		"TYPE", 
		"DBOOL", 
		"DEVICE", 
		"STATE", 
		"ENDDEVICE", 
		"INT", 
		"FLOAT", 
		"IF", 
		"THEN", 
		"ELSE", 
		"FOR", 
		"WHILE", 
		"WAIT", 
		"GO", 
		"ENDPRESSURE", 
		"VAR", 
		"BREAKPOINT", 
		"DEFUN", 
		"WS", 
		"NEWLINE", 
		"LINECOMMENT", 
		"ID", 
		"OBRACKET", 
		"CBRACKET", 
		"CURLYOBRACKET", 
		"CURLYCBRACKET", 
		"EQUALS", 
		"DOT", 
		"SEMI", 
		"COLON", 
		"COMMA"
    };

    public const int OpIncDec = 40;
    public const int WHILE = 60;
    public const int OpLogicalA = 45;
    public const int OBJECTNAME = 25;
    public const int OpAnd = 47;
    public const int CPROGRAM = 4;
    public const int OpLogicalB = 46;
    public const int OpNegation = 41;
    public const int CTYPE = 6;
    public const int DBOOL = 50;
    public const int FOR = 59;
    public const int PARAM = 38;
    public const int FLOAT = 55;
    public const int EQUALS = 75;
    public const int OpAddSub = 44;
    public const int CURLYCBRACKET = 74;
    public const int LINECOMMENT = 69;
    public const int ID = 70;
    public const int EOF = -1;
    public const int CASYNCCALL = 21;
    public const int CSYNCFUNCCALL = 34;
    public const int IF = 56;
    public const int TYPE = 49;
    public const int CIFTE = 9;
    public const int CWAITANYCALL = 23;
    public const int CWAITFUNCFINISH = 35;
    public const int THEN = 57;
    public const int CFORDEC = 13;
    public const int COMMA = 79;
    public const int OpDivMul = 43;
    public const int CDEVICE = 5;
    public const int CURLYOBRACKET = 73;
    public const int CSYNCCALL = 20;
    public const int CFOR = 12;
    public const int DEVICE = 51;
    public const int NODES = 27;
    public const int VAR = 64;
    public const int CREGFUNCACCESS = 31;
    public const int ENDDEVICE = 53;
    public const int DOT = 76;
    public const int CMETHODNAME = 15;
    public const int CBRACKET = 72;
    public const int PARAMS = 37;
    public const int MEMBERNAME = 26;
    public const int CWHILE = 11;
    public const int STATE = 52;
    public const int DEFUN = 66;
    public const int OpUnar = 42;
    public const int CTERMINATEALL = 32;
    public const int CREGMETHACCESS = 30;
    public const int ELSE = 58;
    public const int CDEFUN = 36;
    public const int CSTATEMENT = 8;
    public const int CUNARMIN = 14;
    public const int INT = 54;
    public const int WAIT = 61;
    public const int SEMI = 77;
    public const int CASSIGN = 10;
    public const int COLON = 78;
    public const int CBREAKPOINT = 29;
    public const int CINT = 17;
    public const int WS = 67;
    public const int TERMINATEALL = 39;
    public const int CENDTHECALL = 24;
    public const int NEWLINE = 68;
    public const int OpOr = 48;
    public const int ENDPRESSURE = 63;
    public const int CBLOCK = 7;
    public const int CCALL = 16;
    public const int CASYNCFUNCCALL = 33;
    public const int CGETSTATE = 28;
    public const int GO = 62;
    public const int OBRACKET = 71;
    public const int CBOOL = 19;
    public const int CFLOAT = 18;
    public const int BREAKPOINT = 65;
    public const int CWAITTHECALL = 22;

    // delegates
    // delegators



        public LPMEDParser(ITokenStream input)
    		: this(input, new RecognizerSharedState()) {
        }

        public LPMEDParser(ITokenStream input, RecognizerSharedState state)
    		: base(input, state) {
            InitializeCyclicDFAs();

             
        }
        
    protected ITreeAdaptor adaptor = new CommonTreeAdaptor();

    public ITreeAdaptor TreeAdaptor
    {
        get { return this.adaptor; }
        set {
    	this.adaptor = value;
    	}
    }

    override public string[] TokenNames {
		get { return LPMEDParser.tokenNames; }
    }

    override public string GrammarFileName {
		get { return "LPMEDParser.g"; }
    }


    	public List<Exception> Logger = new List<Exception>();
    	public IFunctionManager functionManager = null;
    	private int functionNesting = 0;


    public class block_return : ParserRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "block"
    // LPMEDParser.g:33:1: block : ( varDecListFixed )* blockStmt ;
    public LPMEDParser.block_return block() // throws RecognitionException [1]
    {   
        LPMEDParser.block_return retval = new LPMEDParser.block_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        LPMEDParser.varDecListFixed_return varDecListFixed1 = default(LPMEDParser.varDecListFixed_return);

        LPMEDParser.blockStmt_return blockStmt2 = default(LPMEDParser.blockStmt_return);



        try 
    	{
            // LPMEDParser.g:33:7: ( ( varDecListFixed )* blockStmt )
            // LPMEDParser.g:33:9: ( varDecListFixed )* blockStmt
            {
            	root_0 = (CommonTree)adaptor.GetNilNode();

            	// LPMEDParser.g:33:9: ( varDecListFixed )*
            	do 
            	{
            	    int alt1 = 2;
            	    int LA1_0 = input.LA(1);

            	    if ( (LA1_0 == VAR) )
            	    {
            	        alt1 = 1;
            	    }


            	    switch (alt1) 
            		{
            			case 1 :
            			    // LPMEDParser.g:33:10: varDecListFixed
            			    {
            			    	PushFollow(FOLLOW_varDecListFixed_in_block70);
            			    	varDecListFixed1 = varDecListFixed();
            			    	state.followingStackPointer--;
            			    	if (state.failed) return retval;
            			    	if ( state.backtracking == 0 ) adaptor.AddChild(root_0, varDecListFixed1.Tree);

            			    }
            			    break;

            			default:
            			    goto loop1;
            	    }
            	} while (true);

            	loop1:
            		;	// Stops C# compiler whining that label 'loop1' has no statements

            	PushFollow(FOLLOW_blockStmt_in_block74);
            	blockStmt2 = blockStmt();
            	state.followingStackPointer--;
            	if (state.failed) return retval;
            	if ( state.backtracking == 0 ) adaptor.AddChild(root_0, blockStmt2.Tree);

            }

            retval.Stop = input.LT(-1);

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);}
        }
        catch (Exception e) 
        {
            Logger.Add(e); if (e is RecognitionException) Recover(input,(RecognitionException)e);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "block"

    public class varDecListFixed_return : ParserRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "varDecListFixed"
    // LPMEDParser.g:36:1: varDecListFixed : VAR ( varDecListAtom )+ -> ( varDecListAtom )+ ;
    public LPMEDParser.varDecListFixed_return varDecListFixed() // throws RecognitionException [1]
    {   
        LPMEDParser.varDecListFixed_return retval = new LPMEDParser.varDecListFixed_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        IToken VAR3 = null;
        LPMEDParser.varDecListAtom_return varDecListAtom4 = default(LPMEDParser.varDecListAtom_return);


        CommonTree VAR3_tree=null;
        RewriteRuleTokenStream stream_VAR = new RewriteRuleTokenStream(adaptor,"token VAR");
        RewriteRuleSubtreeStream stream_varDecListAtom = new RewriteRuleSubtreeStream(adaptor,"rule varDecListAtom");
        try 
    	{
            // LPMEDParser.g:36:17: ( VAR ( varDecListAtom )+ -> ( varDecListAtom )+ )
            // LPMEDParser.g:36:19: VAR ( varDecListAtom )+
            {
            	VAR3=(IToken)Match(input,VAR,FOLLOW_VAR_in_varDecListFixed88); if (state.failed) return retval; 
            	if ( state.backtracking==0 ) stream_VAR.Add(VAR3);

            	// LPMEDParser.g:36:23: ( varDecListAtom )+
            	int cnt2 = 0;
            	do 
            	{
            	    int alt2 = 2;
            	    int LA2_0 = input.LA(1);

            	    if ( (LA2_0 == ID) )
            	    {
            	        alt2 = 1;
            	    }


            	    switch (alt2) 
            		{
            			case 1 :
            			    // LPMEDParser.g:36:24: varDecListAtom
            			    {
            			    	PushFollow(FOLLOW_varDecListAtom_in_varDecListFixed91);
            			    	varDecListAtom4 = varDecListAtom();
            			    	state.followingStackPointer--;
            			    	if (state.failed) return retval;
            			    	if ( state.backtracking==0 ) stream_varDecListAtom.Add(varDecListAtom4.Tree);

            			    }
            			    break;

            			default:
            			    if ( cnt2 >= 1 ) goto loop2;
            			    if ( state.backtracking > 0 ) {state.failed = true; return retval;}
            		            EarlyExitException eee =
            		                new EarlyExitException(2, input);
            		            throw eee;
            	    }
            	    cnt2++;
            	} while (true);

            	loop2:
            		;	// Stops C# compiler whinging that label 'loop2' has no statements



            	// AST REWRITE
            	// elements:          varDecListAtom
            	// token labels:      
            	// rule labels:       retval
            	// token list labels: 
            	// rule list labels:  
            	if ( state.backtracking==0 ) {
            	retval.Tree = root_0;
            	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

            	root_0 = (CommonTree)adaptor.GetNilNode();
            	// 36:41: -> ( varDecListAtom )+
            	{
            	    if ( !(stream_varDecListAtom.HasNext()) ) {
            	        throw new RewriteEarlyExitException();
            	    }
            	    while ( stream_varDecListAtom.HasNext() )
            	    {
            	        adaptor.AddChild(root_0, stream_varDecListAtom.NextTree());

            	    }
            	    stream_varDecListAtom.Reset();

            	}

            	retval.Tree = root_0;retval.Tree = root_0;}
            }

            retval.Stop = input.LT(-1);

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);}
        }
        catch (Exception e) 
        {
            Logger.Add(e); if (e is RecognitionException) Recover(input,(RecognitionException)e);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "varDecListFixed"

    public class varDecListFree_return : ParserRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "varDecListFree"
    // LPMEDParser.g:39:1: varDecListFree : VAR ( ID ( COMMA ID )* COLON TYPE SEMI ) -> ^( CTYPE TYPE ( ID )+ ) ;
    public LPMEDParser.varDecListFree_return varDecListFree() // throws RecognitionException [1]
    {   
        LPMEDParser.varDecListFree_return retval = new LPMEDParser.varDecListFree_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        IToken VAR5 = null;
        IToken ID6 = null;
        IToken COMMA7 = null;
        IToken ID8 = null;
        IToken COLON9 = null;
        IToken TYPE10 = null;
        IToken SEMI11 = null;

        CommonTree VAR5_tree=null;
        CommonTree ID6_tree=null;
        CommonTree COMMA7_tree=null;
        CommonTree ID8_tree=null;
        CommonTree COLON9_tree=null;
        CommonTree TYPE10_tree=null;
        CommonTree SEMI11_tree=null;
        RewriteRuleTokenStream stream_COLON = new RewriteRuleTokenStream(adaptor,"token COLON");
        RewriteRuleTokenStream stream_VAR = new RewriteRuleTokenStream(adaptor,"token VAR");
        RewriteRuleTokenStream stream_ID = new RewriteRuleTokenStream(adaptor,"token ID");
        RewriteRuleTokenStream stream_COMMA = new RewriteRuleTokenStream(adaptor,"token COMMA");
        RewriteRuleTokenStream stream_SEMI = new RewriteRuleTokenStream(adaptor,"token SEMI");
        RewriteRuleTokenStream stream_TYPE = new RewriteRuleTokenStream(adaptor,"token TYPE");

        try 
    	{
            // LPMEDParser.g:39:16: ( VAR ( ID ( COMMA ID )* COLON TYPE SEMI ) -> ^( CTYPE TYPE ( ID )+ ) )
            // LPMEDParser.g:39:18: VAR ( ID ( COMMA ID )* COLON TYPE SEMI )
            {
            	VAR5=(IToken)Match(input,VAR,FOLLOW_VAR_in_varDecListFree113); if (state.failed) return retval; 
            	if ( state.backtracking==0 ) stream_VAR.Add(VAR5);

            	// LPMEDParser.g:39:22: ( ID ( COMMA ID )* COLON TYPE SEMI )
            	// LPMEDParser.g:39:23: ID ( COMMA ID )* COLON TYPE SEMI
            	{
            		ID6=(IToken)Match(input,ID,FOLLOW_ID_in_varDecListFree116); if (state.failed) return retval; 
            		if ( state.backtracking==0 ) stream_ID.Add(ID6);

            		// LPMEDParser.g:39:26: ( COMMA ID )*
            		do 
            		{
            		    int alt3 = 2;
            		    int LA3_0 = input.LA(1);

            		    if ( (LA3_0 == COMMA) )
            		    {
            		        alt3 = 1;
            		    }


            		    switch (alt3) 
            			{
            				case 1 :
            				    // LPMEDParser.g:39:27: COMMA ID
            				    {
            				    	COMMA7=(IToken)Match(input,COMMA,FOLLOW_COMMA_in_varDecListFree119); if (state.failed) return retval; 
            				    	if ( state.backtracking==0 ) stream_COMMA.Add(COMMA7);

            				    	ID8=(IToken)Match(input,ID,FOLLOW_ID_in_varDecListFree121); if (state.failed) return retval; 
            				    	if ( state.backtracking==0 ) stream_ID.Add(ID8);


            				    }
            				    break;

            				default:
            				    goto loop3;
            		    }
            		} while (true);

            		loop3:
            			;	// Stops C# compiler whining that label 'loop3' has no statements

            		COLON9=(IToken)Match(input,COLON,FOLLOW_COLON_in_varDecListFree126); if (state.failed) return retval; 
            		if ( state.backtracking==0 ) stream_COLON.Add(COLON9);

            		TYPE10=(IToken)Match(input,TYPE,FOLLOW_TYPE_in_varDecListFree128); if (state.failed) return retval; 
            		if ( state.backtracking==0 ) stream_TYPE.Add(TYPE10);

            		SEMI11=(IToken)Match(input,SEMI,FOLLOW_SEMI_in_varDecListFree130); if (state.failed) return retval; 
            		if ( state.backtracking==0 ) stream_SEMI.Add(SEMI11);


            	}



            	// AST REWRITE
            	// elements:          TYPE, ID
            	// token labels:      
            	// rule labels:       retval
            	// token list labels: 
            	// rule list labels:  
            	if ( state.backtracking==0 ) {
            	retval.Tree = root_0;
            	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

            	root_0 = (CommonTree)adaptor.GetNilNode();
            	// 39:56: -> ^( CTYPE TYPE ( ID )+ )
            	{
            	    // LPMEDParser.g:39:59: ^( CTYPE TYPE ( ID )+ )
            	    {
            	    CommonTree root_1 = (CommonTree)adaptor.GetNilNode();
            	    root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(CTYPE, "CTYPE"), root_1);

            	    adaptor.AddChild(root_1, stream_TYPE.NextNode());
            	    if ( !(stream_ID.HasNext()) ) {
            	        throw new RewriteEarlyExitException();
            	    }
            	    while ( stream_ID.HasNext() )
            	    {
            	        adaptor.AddChild(root_1, stream_ID.NextNode());

            	    }
            	    stream_ID.Reset();

            	    adaptor.AddChild(root_0, root_1);
            	    }

            	}

            	retval.Tree = root_0;retval.Tree = root_0;}
            }

            retval.Stop = input.LT(-1);

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);}
        }
        catch (Exception e) 
        {
            Logger.Add(e); if (e is RecognitionException) Recover(input,(RecognitionException)e);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "varDecListFree"

    public class varDecListAtom_return : ParserRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "varDecListAtom"
    // LPMEDParser.g:42:1: varDecListAtom : ( peremDecList COLON TYPE SEMI ) -> ^( CTYPE TYPE peremDecList ) ;
    public LPMEDParser.varDecListAtom_return varDecListAtom() // throws RecognitionException [1]
    {   
        LPMEDParser.varDecListAtom_return retval = new LPMEDParser.varDecListAtom_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        IToken COLON13 = null;
        IToken TYPE14 = null;
        IToken SEMI15 = null;
        LPMEDParser.peremDecList_return peremDecList12 = default(LPMEDParser.peremDecList_return);


        CommonTree COLON13_tree=null;
        CommonTree TYPE14_tree=null;
        CommonTree SEMI15_tree=null;
        RewriteRuleTokenStream stream_COLON = new RewriteRuleTokenStream(adaptor,"token COLON");
        RewriteRuleTokenStream stream_SEMI = new RewriteRuleTokenStream(adaptor,"token SEMI");
        RewriteRuleTokenStream stream_TYPE = new RewriteRuleTokenStream(adaptor,"token TYPE");
        RewriteRuleSubtreeStream stream_peremDecList = new RewriteRuleSubtreeStream(adaptor,"rule peremDecList");
        try 
    	{
            // LPMEDParser.g:42:16: ( ( peremDecList COLON TYPE SEMI ) -> ^( CTYPE TYPE peremDecList ) )
            // LPMEDParser.g:42:18: ( peremDecList COLON TYPE SEMI )
            {
            	// LPMEDParser.g:42:18: ( peremDecList COLON TYPE SEMI )
            	// LPMEDParser.g:42:19: peremDecList COLON TYPE SEMI
            	{
            		PushFollow(FOLLOW_peremDecList_in_varDecListAtom157);
            		peremDecList12 = peremDecList();
            		state.followingStackPointer--;
            		if (state.failed) return retval;
            		if ( state.backtracking==0 ) stream_peremDecList.Add(peremDecList12.Tree);
            		COLON13=(IToken)Match(input,COLON,FOLLOW_COLON_in_varDecListAtom159); if (state.failed) return retval; 
            		if ( state.backtracking==0 ) stream_COLON.Add(COLON13);

            		TYPE14=(IToken)Match(input,TYPE,FOLLOW_TYPE_in_varDecListAtom161); if (state.failed) return retval; 
            		if ( state.backtracking==0 ) stream_TYPE.Add(TYPE14);

            		SEMI15=(IToken)Match(input,SEMI,FOLLOW_SEMI_in_varDecListAtom163); if (state.failed) return retval; 
            		if ( state.backtracking==0 ) stream_SEMI.Add(SEMI15);


            	}



            	// AST REWRITE
            	// elements:          TYPE, peremDecList
            	// token labels:      
            	// rule labels:       retval
            	// token list labels: 
            	// rule list labels:  
            	if ( state.backtracking==0 ) {
            	retval.Tree = root_0;
            	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

            	root_0 = (CommonTree)adaptor.GetNilNode();
            	// 42:50: -> ^( CTYPE TYPE peremDecList )
            	{
            	    // LPMEDParser.g:42:53: ^( CTYPE TYPE peremDecList )
            	    {
            	    CommonTree root_1 = (CommonTree)adaptor.GetNilNode();
            	    root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(CTYPE, "CTYPE"), root_1);

            	    adaptor.AddChild(root_1, stream_TYPE.NextNode());
            	    adaptor.AddChild(root_1, stream_peremDecList.NextTree());

            	    adaptor.AddChild(root_0, root_1);
            	    }

            	}

            	retval.Tree = root_0;retval.Tree = root_0;}
            }

            retval.Stop = input.LT(-1);

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);}
        }
        catch (Exception e) 
        {
            Logger.Add(e); if (e is RecognitionException) Recover(input,(RecognitionException)e);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "varDecListAtom"

    public class peremDecList_return : ParserRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "peremDecList"
    // LPMEDParser.g:45:1: peremDecList : ID ( COMMA ID )* -> ( ID )+ ;
    public LPMEDParser.peremDecList_return peremDecList() // throws RecognitionException [1]
    {   
        LPMEDParser.peremDecList_return retval = new LPMEDParser.peremDecList_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        IToken ID16 = null;
        IToken COMMA17 = null;
        IToken ID18 = null;

        CommonTree ID16_tree=null;
        CommonTree COMMA17_tree=null;
        CommonTree ID18_tree=null;
        RewriteRuleTokenStream stream_ID = new RewriteRuleTokenStream(adaptor,"token ID");
        RewriteRuleTokenStream stream_COMMA = new RewriteRuleTokenStream(adaptor,"token COMMA");

        try 
    	{
            // LPMEDParser.g:45:14: ( ID ( COMMA ID )* -> ( ID )+ )
            // LPMEDParser.g:45:16: ID ( COMMA ID )*
            {
            	ID16=(IToken)Match(input,ID,FOLLOW_ID_in_peremDecList190); if (state.failed) return retval; 
            	if ( state.backtracking==0 ) stream_ID.Add(ID16);

            	// LPMEDParser.g:45:19: ( COMMA ID )*
            	do 
            	{
            	    int alt4 = 2;
            	    int LA4_0 = input.LA(1);

            	    if ( (LA4_0 == COMMA) )
            	    {
            	        alt4 = 1;
            	    }


            	    switch (alt4) 
            		{
            			case 1 :
            			    // LPMEDParser.g:45:20: COMMA ID
            			    {
            			    	COMMA17=(IToken)Match(input,COMMA,FOLLOW_COMMA_in_peremDecList193); if (state.failed) return retval; 
            			    	if ( state.backtracking==0 ) stream_COMMA.Add(COMMA17);

            			    	ID18=(IToken)Match(input,ID,FOLLOW_ID_in_peremDecList195); if (state.failed) return retval; 
            			    	if ( state.backtracking==0 ) stream_ID.Add(ID18);


            			    }
            			    break;

            			default:
            			    goto loop4;
            	    }
            	} while (true);

            	loop4:
            		;	// Stops C# compiler whining that label 'loop4' has no statements



            	// AST REWRITE
            	// elements:          ID
            	// token labels:      
            	// rule labels:       retval
            	// token list labels: 
            	// rule list labels:  
            	if ( state.backtracking==0 ) {
            	retval.Tree = root_0;
            	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

            	root_0 = (CommonTree)adaptor.GetNilNode();
            	// 45:32: -> ( ID )+
            	{
            	    if ( !(stream_ID.HasNext()) ) {
            	        throw new RewriteEarlyExitException();
            	    }
            	    while ( stream_ID.HasNext() )
            	    {
            	        adaptor.AddChild(root_0, stream_ID.NextNode());

            	    }
            	    stream_ID.Reset();

            	}

            	retval.Tree = root_0;retval.Tree = root_0;}
            }

            retval.Stop = input.LT(-1);

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);}
        }
        catch (Exception e) 
        {
            Logger.Add(e); if (e is RecognitionException) Recover(input,(RecognitionException)e);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "peremDecList"

    public class blockStmt_return : ParserRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "blockStmt"
    // LPMEDParser.g:48:1: blockStmt : CURLYOBRACKET ( stmt )* CURLYCBRACKET -> ^( CSTATEMENT ( stmt )* ) ;
    public LPMEDParser.blockStmt_return blockStmt() // throws RecognitionException [1]
    {   
        LPMEDParser.blockStmt_return retval = new LPMEDParser.blockStmt_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        IToken CURLYOBRACKET19 = null;
        IToken CURLYCBRACKET21 = null;
        LPMEDParser.stmt_return stmt20 = default(LPMEDParser.stmt_return);


        CommonTree CURLYOBRACKET19_tree=null;
        CommonTree CURLYCBRACKET21_tree=null;
        RewriteRuleTokenStream stream_CURLYCBRACKET = new RewriteRuleTokenStream(adaptor,"token CURLYCBRACKET");
        RewriteRuleTokenStream stream_CURLYOBRACKET = new RewriteRuleTokenStream(adaptor,"token CURLYOBRACKET");
        RewriteRuleSubtreeStream stream_stmt = new RewriteRuleSubtreeStream(adaptor,"rule stmt");
        try 
    	{
            // LPMEDParser.g:48:11: ( CURLYOBRACKET ( stmt )* CURLYCBRACKET -> ^( CSTATEMENT ( stmt )* ) )
            // LPMEDParser.g:48:13: CURLYOBRACKET ( stmt )* CURLYCBRACKET
            {
            	CURLYOBRACKET19=(IToken)Match(input,CURLYOBRACKET,FOLLOW_CURLYOBRACKET_in_blockStmt216); if (state.failed) return retval; 
            	if ( state.backtracking==0 ) stream_CURLYOBRACKET.Add(CURLYOBRACKET19);

            	// LPMEDParser.g:48:27: ( stmt )*
            	do 
            	{
            	    int alt5 = 2;
            	    int LA5_0 = input.LA(1);

            	    if ( (LA5_0 == TERMINATEALL || LA5_0 == IF || (LA5_0 >= FOR && LA5_0 <= WHILE) || (LA5_0 >= BREAKPOINT && LA5_0 <= DEFUN) || LA5_0 == ID || LA5_0 == CURLYOBRACKET) )
            	    {
            	        alt5 = 1;
            	    }


            	    switch (alt5) 
            		{
            			case 1 :
            			    // LPMEDParser.g:48:28: stmt
            			    {
            			    	PushFollow(FOLLOW_stmt_in_blockStmt219);
            			    	stmt20 = stmt();
            			    	state.followingStackPointer--;
            			    	if (state.failed) return retval;
            			    	if ( state.backtracking==0 ) stream_stmt.Add(stmt20.Tree);

            			    }
            			    break;

            			default:
            			    goto loop5;
            	    }
            	} while (true);

            	loop5:
            		;	// Stops C# compiler whining that label 'loop5' has no statements

            	CURLYCBRACKET21=(IToken)Match(input,CURLYCBRACKET,FOLLOW_CURLYCBRACKET_in_blockStmt223); if (state.failed) return retval; 
            	if ( state.backtracking==0 ) stream_CURLYCBRACKET.Add(CURLYCBRACKET21);



            	// AST REWRITE
            	// elements:          stmt
            	// token labels:      
            	// rule labels:       retval
            	// token list labels: 
            	// rule list labels:  
            	if ( state.backtracking==0 ) {
            	retval.Tree = root_0;
            	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

            	root_0 = (CommonTree)adaptor.GetNilNode();
            	// 48:50: -> ^( CSTATEMENT ( stmt )* )
            	{
            	    // LPMEDParser.g:48:53: ^( CSTATEMENT ( stmt )* )
            	    {
            	    CommonTree root_1 = (CommonTree)adaptor.GetNilNode();
            	    root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(CSTATEMENT, "CSTATEMENT"), root_1);

            	    // LPMEDParser.g:48:66: ( stmt )*
            	    while ( stream_stmt.HasNext() )
            	    {
            	        adaptor.AddChild(root_1, stream_stmt.NextTree());

            	    }
            	    stream_stmt.Reset();

            	    adaptor.AddChild(root_0, root_1);
            	    }

            	}

            	retval.Tree = root_0;retval.Tree = root_0;}
            }

            retval.Stop = input.LT(-1);

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);}
        }
        catch (Exception e) 
        {
            Logger.Add(e); if (e is RecognitionException) Recover(input,(RecognitionException)e);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "blockStmt"

    public class stmt_return : ParserRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "stmt"
    // LPMEDParser.g:51:1: stmt options {backtrack=false; } : ( assign SEMI -> assign | ifStmt | WHILE OBRACKET expr CBRACKET blockStmt -> ^( CWHILE expr blockStmt ) | FOR OBRACKET assign SEMI expr SEMI assign CBRACKET blockStmt -> ^( CFOR assign expr assign blockStmt ) | deviceMethodCall SEMI -> deviceMethodCall | blockStmt | BREAKPOINT OBRACKET INT CBRACKET SEMI -> ^( CBREAKPOINT INT ) | TERMINATEALL SEMI -> ^( CTERMINATEALL ) | functionCall SEMI -> functionCall | functionDefinition ->);
    public LPMEDParser.stmt_return stmt() // throws RecognitionException [1]
    {   
        LPMEDParser.stmt_return retval = new LPMEDParser.stmt_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        IToken SEMI23 = null;
        IToken WHILE25 = null;
        IToken OBRACKET26 = null;
        IToken CBRACKET28 = null;
        IToken FOR30 = null;
        IToken OBRACKET31 = null;
        IToken SEMI33 = null;
        IToken SEMI35 = null;
        IToken CBRACKET37 = null;
        IToken SEMI40 = null;
        IToken BREAKPOINT42 = null;
        IToken OBRACKET43 = null;
        IToken INT44 = null;
        IToken CBRACKET45 = null;
        IToken SEMI46 = null;
        IToken TERMINATEALL47 = null;
        IToken SEMI48 = null;
        IToken SEMI50 = null;
        LPMEDParser.assign_return assign22 = default(LPMEDParser.assign_return);

        LPMEDParser.ifStmt_return ifStmt24 = default(LPMEDParser.ifStmt_return);

        LPMEDParser.expr_return expr27 = default(LPMEDParser.expr_return);

        LPMEDParser.blockStmt_return blockStmt29 = default(LPMEDParser.blockStmt_return);

        LPMEDParser.assign_return assign32 = default(LPMEDParser.assign_return);

        LPMEDParser.expr_return expr34 = default(LPMEDParser.expr_return);

        LPMEDParser.assign_return assign36 = default(LPMEDParser.assign_return);

        LPMEDParser.blockStmt_return blockStmt38 = default(LPMEDParser.blockStmt_return);

        LPMEDParser.deviceMethodCall_return deviceMethodCall39 = default(LPMEDParser.deviceMethodCall_return);

        LPMEDParser.blockStmt_return blockStmt41 = default(LPMEDParser.blockStmt_return);

        LPMEDParser.functionCall_return functionCall49 = default(LPMEDParser.functionCall_return);

        LPMEDParser.functionDefinition_return functionDefinition51 = default(LPMEDParser.functionDefinition_return);


        CommonTree SEMI23_tree=null;
        CommonTree WHILE25_tree=null;
        CommonTree OBRACKET26_tree=null;
        CommonTree CBRACKET28_tree=null;
        CommonTree FOR30_tree=null;
        CommonTree OBRACKET31_tree=null;
        CommonTree SEMI33_tree=null;
        CommonTree SEMI35_tree=null;
        CommonTree CBRACKET37_tree=null;
        CommonTree SEMI40_tree=null;
        CommonTree BREAKPOINT42_tree=null;
        CommonTree OBRACKET43_tree=null;
        CommonTree INT44_tree=null;
        CommonTree CBRACKET45_tree=null;
        CommonTree SEMI46_tree=null;
        CommonTree TERMINATEALL47_tree=null;
        CommonTree SEMI48_tree=null;
        CommonTree SEMI50_tree=null;
        RewriteRuleTokenStream stream_FOR = new RewriteRuleTokenStream(adaptor,"token FOR");
        RewriteRuleTokenStream stream_INT = new RewriteRuleTokenStream(adaptor,"token INT");
        RewriteRuleTokenStream stream_TERMINATEALL = new RewriteRuleTokenStream(adaptor,"token TERMINATEALL");
        RewriteRuleTokenStream stream_WHILE = new RewriteRuleTokenStream(adaptor,"token WHILE");
        RewriteRuleTokenStream stream_OBRACKET = new RewriteRuleTokenStream(adaptor,"token OBRACKET");
        RewriteRuleTokenStream stream_SEMI = new RewriteRuleTokenStream(adaptor,"token SEMI");
        RewriteRuleTokenStream stream_BREAKPOINT = new RewriteRuleTokenStream(adaptor,"token BREAKPOINT");
        RewriteRuleTokenStream stream_CBRACKET = new RewriteRuleTokenStream(adaptor,"token CBRACKET");
        RewriteRuleSubtreeStream stream_functionCall = new RewriteRuleSubtreeStream(adaptor,"rule functionCall");
        RewriteRuleSubtreeStream stream_assign = new RewriteRuleSubtreeStream(adaptor,"rule assign");
        RewriteRuleSubtreeStream stream_functionDefinition = new RewriteRuleSubtreeStream(adaptor,"rule functionDefinition");
        RewriteRuleSubtreeStream stream_blockStmt = new RewriteRuleSubtreeStream(adaptor,"rule blockStmt");
        RewriteRuleSubtreeStream stream_expr = new RewriteRuleSubtreeStream(adaptor,"rule expr");
        RewriteRuleSubtreeStream stream_deviceMethodCall = new RewriteRuleSubtreeStream(adaptor,"rule deviceMethodCall");
        try 
    	{
            // LPMEDParser.g:53:1: ( assign SEMI -> assign | ifStmt | WHILE OBRACKET expr CBRACKET blockStmt -> ^( CWHILE expr blockStmt ) | FOR OBRACKET assign SEMI expr SEMI assign CBRACKET blockStmt -> ^( CFOR assign expr assign blockStmt ) | deviceMethodCall SEMI -> deviceMethodCall | blockStmt | BREAKPOINT OBRACKET INT CBRACKET SEMI -> ^( CBREAKPOINT INT ) | TERMINATEALL SEMI -> ^( CTERMINATEALL ) | functionCall SEMI -> functionCall | functionDefinition ->)
            int alt6 = 10;
            alt6 = dfa6.Predict(input);
            switch (alt6) 
            {
                case 1 :
                    // LPMEDParser.g:53:5: assign SEMI
                    {
                    	PushFollow(FOLLOW_assign_in_stmt257);
                    	assign22 = assign();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) stream_assign.Add(assign22.Tree);
                    	SEMI23=(IToken)Match(input,SEMI,FOLLOW_SEMI_in_stmt259); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_SEMI.Add(SEMI23);



                    	// AST REWRITE
                    	// elements:          assign
                    	// token labels:      
                    	// rule labels:       retval
                    	// token list labels: 
                    	// rule list labels:  
                    	if ( state.backtracking==0 ) {
                    	retval.Tree = root_0;
                    	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

                    	root_0 = (CommonTree)adaptor.GetNilNode();
                    	// 53:17: -> assign
                    	{
                    	    adaptor.AddChild(root_0, stream_assign.NextTree());

                    	}

                    	retval.Tree = root_0;retval.Tree = root_0;}
                    }
                    break;
                case 2 :
                    // LPMEDParser.g:54:5: ifStmt
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	PushFollow(FOLLOW_ifStmt_in_stmt269);
                    	ifStmt24 = ifStmt();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking == 0 ) adaptor.AddChild(root_0, ifStmt24.Tree);

                    }
                    break;
                case 3 :
                    // LPMEDParser.g:55:5: WHILE OBRACKET expr CBRACKET blockStmt
                    {
                    	WHILE25=(IToken)Match(input,WHILE,FOLLOW_WHILE_in_stmt275); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_WHILE.Add(WHILE25);

                    	OBRACKET26=(IToken)Match(input,OBRACKET,FOLLOW_OBRACKET_in_stmt277); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_OBRACKET.Add(OBRACKET26);

                    	PushFollow(FOLLOW_expr_in_stmt279);
                    	expr27 = expr();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) stream_expr.Add(expr27.Tree);
                    	CBRACKET28=(IToken)Match(input,CBRACKET,FOLLOW_CBRACKET_in_stmt281); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_CBRACKET.Add(CBRACKET28);

                    	PushFollow(FOLLOW_blockStmt_in_stmt283);
                    	blockStmt29 = blockStmt();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) stream_blockStmt.Add(blockStmt29.Tree);


                    	// AST REWRITE
                    	// elements:          expr, blockStmt
                    	// token labels:      
                    	// rule labels:       retval
                    	// token list labels: 
                    	// rule list labels:  
                    	if ( state.backtracking==0 ) {
                    	retval.Tree = root_0;
                    	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

                    	root_0 = (CommonTree)adaptor.GetNilNode();
                    	// 55:44: -> ^( CWHILE expr blockStmt )
                    	{
                    	    // LPMEDParser.g:55:47: ^( CWHILE expr blockStmt )
                    	    {
                    	    CommonTree root_1 = (CommonTree)adaptor.GetNilNode();
                    	    root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(CWHILE, "CWHILE"), root_1);

                    	    adaptor.AddChild(root_1, stream_expr.NextTree());
                    	    adaptor.AddChild(root_1, stream_blockStmt.NextTree());

                    	    adaptor.AddChild(root_0, root_1);
                    	    }

                    	}

                    	retval.Tree = root_0;retval.Tree = root_0;}
                    }
                    break;
                case 4 :
                    // LPMEDParser.g:56:5: FOR OBRACKET assign SEMI expr SEMI assign CBRACKET blockStmt
                    {
                    	FOR30=(IToken)Match(input,FOR,FOLLOW_FOR_in_stmt299); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_FOR.Add(FOR30);

                    	OBRACKET31=(IToken)Match(input,OBRACKET,FOLLOW_OBRACKET_in_stmt301); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_OBRACKET.Add(OBRACKET31);

                    	PushFollow(FOLLOW_assign_in_stmt303);
                    	assign32 = assign();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) stream_assign.Add(assign32.Tree);
                    	SEMI33=(IToken)Match(input,SEMI,FOLLOW_SEMI_in_stmt305); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_SEMI.Add(SEMI33);

                    	PushFollow(FOLLOW_expr_in_stmt307);
                    	expr34 = expr();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) stream_expr.Add(expr34.Tree);
                    	SEMI35=(IToken)Match(input,SEMI,FOLLOW_SEMI_in_stmt309); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_SEMI.Add(SEMI35);

                    	PushFollow(FOLLOW_assign_in_stmt311);
                    	assign36 = assign();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) stream_assign.Add(assign36.Tree);
                    	CBRACKET37=(IToken)Match(input,CBRACKET,FOLLOW_CBRACKET_in_stmt313); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_CBRACKET.Add(CBRACKET37);

                    	PushFollow(FOLLOW_blockStmt_in_stmt315);
                    	blockStmt38 = blockStmt();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) stream_blockStmt.Add(blockStmt38.Tree);


                    	// AST REWRITE
                    	// elements:          assign, blockStmt, assign, expr
                    	// token labels:      
                    	// rule labels:       retval
                    	// token list labels: 
                    	// rule list labels:  
                    	if ( state.backtracking==0 ) {
                    	retval.Tree = root_0;
                    	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

                    	root_0 = (CommonTree)adaptor.GetNilNode();
                    	// 56:66: -> ^( CFOR assign expr assign blockStmt )
                    	{
                    	    // LPMEDParser.g:56:69: ^( CFOR assign expr assign blockStmt )
                    	    {
                    	    CommonTree root_1 = (CommonTree)adaptor.GetNilNode();
                    	    root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(CFOR, "CFOR"), root_1);

                    	    adaptor.AddChild(root_1, stream_assign.NextTree());
                    	    adaptor.AddChild(root_1, stream_expr.NextTree());
                    	    adaptor.AddChild(root_1, stream_assign.NextTree());
                    	    adaptor.AddChild(root_1, stream_blockStmt.NextTree());

                    	    adaptor.AddChild(root_0, root_1);
                    	    }

                    	}

                    	retval.Tree = root_0;retval.Tree = root_0;}
                    }
                    break;
                case 5 :
                    // LPMEDParser.g:57:5: deviceMethodCall SEMI
                    {
                    	PushFollow(FOLLOW_deviceMethodCall_in_stmt335);
                    	deviceMethodCall39 = deviceMethodCall();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) stream_deviceMethodCall.Add(deviceMethodCall39.Tree);
                    	SEMI40=(IToken)Match(input,SEMI,FOLLOW_SEMI_in_stmt337); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_SEMI.Add(SEMI40);



                    	// AST REWRITE
                    	// elements:          deviceMethodCall
                    	// token labels:      
                    	// rule labels:       retval
                    	// token list labels: 
                    	// rule list labels:  
                    	if ( state.backtracking==0 ) {
                    	retval.Tree = root_0;
                    	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

                    	root_0 = (CommonTree)adaptor.GetNilNode();
                    	// 57:27: -> deviceMethodCall
                    	{
                    	    adaptor.AddChild(root_0, stream_deviceMethodCall.NextTree());

                    	}

                    	retval.Tree = root_0;retval.Tree = root_0;}
                    }
                    break;
                case 6 :
                    // LPMEDParser.g:58:5: blockStmt
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	PushFollow(FOLLOW_blockStmt_in_stmt347);
                    	blockStmt41 = blockStmt();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking == 0 ) adaptor.AddChild(root_0, blockStmt41.Tree);

                    }
                    break;
                case 7 :
                    // LPMEDParser.g:59:5: BREAKPOINT OBRACKET INT CBRACKET SEMI
                    {
                    	BREAKPOINT42=(IToken)Match(input,BREAKPOINT,FOLLOW_BREAKPOINT_in_stmt353); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_BREAKPOINT.Add(BREAKPOINT42);

                    	OBRACKET43=(IToken)Match(input,OBRACKET,FOLLOW_OBRACKET_in_stmt355); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_OBRACKET.Add(OBRACKET43);

                    	INT44=(IToken)Match(input,INT,FOLLOW_INT_in_stmt357); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_INT.Add(INT44);

                    	CBRACKET45=(IToken)Match(input,CBRACKET,FOLLOW_CBRACKET_in_stmt359); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_CBRACKET.Add(CBRACKET45);

                    	SEMI46=(IToken)Match(input,SEMI,FOLLOW_SEMI_in_stmt361); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_SEMI.Add(SEMI46);



                    	// AST REWRITE
                    	// elements:          INT
                    	// token labels:      
                    	// rule labels:       retval
                    	// token list labels: 
                    	// rule list labels:  
                    	if ( state.backtracking==0 ) {
                    	retval.Tree = root_0;
                    	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

                    	root_0 = (CommonTree)adaptor.GetNilNode();
                    	// 59:43: -> ^( CBREAKPOINT INT )
                    	{
                    	    // LPMEDParser.g:59:46: ^( CBREAKPOINT INT )
                    	    {
                    	    CommonTree root_1 = (CommonTree)adaptor.GetNilNode();
                    	    root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(CBREAKPOINT, "CBREAKPOINT"), root_1);

                    	    adaptor.AddChild(root_1, stream_INT.NextNode());

                    	    adaptor.AddChild(root_0, root_1);
                    	    }

                    	}

                    	retval.Tree = root_0;retval.Tree = root_0;}
                    }
                    break;
                case 8 :
                    // LPMEDParser.g:60:5: TERMINATEALL SEMI
                    {
                    	TERMINATEALL47=(IToken)Match(input,TERMINATEALL,FOLLOW_TERMINATEALL_in_stmt375); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_TERMINATEALL.Add(TERMINATEALL47);

                    	SEMI48=(IToken)Match(input,SEMI,FOLLOW_SEMI_in_stmt377); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_SEMI.Add(SEMI48);



                    	// AST REWRITE
                    	// elements:          
                    	// token labels:      
                    	// rule labels:       retval
                    	// token list labels: 
                    	// rule list labels:  
                    	if ( state.backtracking==0 ) {
                    	retval.Tree = root_0;
                    	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

                    	root_0 = (CommonTree)adaptor.GetNilNode();
                    	// 60:23: -> ^( CTERMINATEALL )
                    	{
                    	    // LPMEDParser.g:60:26: ^( CTERMINATEALL )
                    	    {
                    	    CommonTree root_1 = (CommonTree)adaptor.GetNilNode();
                    	    root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(CTERMINATEALL, "CTERMINATEALL"), root_1);

                    	    adaptor.AddChild(root_0, root_1);
                    	    }

                    	}

                    	retval.Tree = root_0;retval.Tree = root_0;}
                    }
                    break;
                case 9 :
                    // LPMEDParser.g:61:5: functionCall SEMI
                    {
                    	PushFollow(FOLLOW_functionCall_in_stmt389);
                    	functionCall49 = functionCall();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) stream_functionCall.Add(functionCall49.Tree);
                    	SEMI50=(IToken)Match(input,SEMI,FOLLOW_SEMI_in_stmt391); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_SEMI.Add(SEMI50);



                    	// AST REWRITE
                    	// elements:          functionCall
                    	// token labels:      
                    	// rule labels:       retval
                    	// token list labels: 
                    	// rule list labels:  
                    	if ( state.backtracking==0 ) {
                    	retval.Tree = root_0;
                    	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

                    	root_0 = (CommonTree)adaptor.GetNilNode();
                    	// 61:23: -> functionCall
                    	{
                    	    adaptor.AddChild(root_0, stream_functionCall.NextTree());

                    	}

                    	retval.Tree = root_0;retval.Tree = root_0;}
                    }
                    break;
                case 10 :
                    // LPMEDParser.g:62:5: functionDefinition
                    {
                    	PushFollow(FOLLOW_functionDefinition_in_stmt401);
                    	functionDefinition51 = functionDefinition();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) stream_functionDefinition.Add(functionDefinition51.Tree);


                    	// AST REWRITE
                    	// elements:          
                    	// token labels:      
                    	// rule labels:       retval
                    	// token list labels: 
                    	// rule list labels:  
                    	if ( state.backtracking==0 ) {
                    	retval.Tree = root_0;
                    	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

                    	root_0 = (CommonTree)adaptor.GetNilNode();
                    	// 62:24: ->
                    	{
                    	    root_0 = null;
                    	}

                    	retval.Tree = root_0;retval.Tree = root_0;}
                    }
                    break;

            }
            retval.Stop = input.LT(-1);

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);}
        }
        catch (Exception e) 
        {
            Logger.Add(e); if (e is RecognitionException) Recover(input,(RecognitionException)e);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "stmt"

    public class ifStmt_return : ParserRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "ifStmt"
    // LPMEDParser.g:67:1: ifStmt options {backtrack=true; } : ( IF OBRACKET expr CBRACKET THEN th= blockStmt ELSE el= blockStmt -> ^( CIFTE expr $th $el) | IF OBRACKET expr CBRACKET THEN blockStmt -> ^( CIFTE expr blockStmt ) );
    public LPMEDParser.ifStmt_return ifStmt() // throws RecognitionException [1]
    {   
        LPMEDParser.ifStmt_return retval = new LPMEDParser.ifStmt_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        IToken IF52 = null;
        IToken OBRACKET53 = null;
        IToken CBRACKET55 = null;
        IToken THEN56 = null;
        IToken ELSE57 = null;
        IToken IF58 = null;
        IToken OBRACKET59 = null;
        IToken CBRACKET61 = null;
        IToken THEN62 = null;
        LPMEDParser.blockStmt_return th = default(LPMEDParser.blockStmt_return);

        LPMEDParser.blockStmt_return el = default(LPMEDParser.blockStmt_return);

        LPMEDParser.expr_return expr54 = default(LPMEDParser.expr_return);

        LPMEDParser.expr_return expr60 = default(LPMEDParser.expr_return);

        LPMEDParser.blockStmt_return blockStmt63 = default(LPMEDParser.blockStmt_return);


        CommonTree IF52_tree=null;
        CommonTree OBRACKET53_tree=null;
        CommonTree CBRACKET55_tree=null;
        CommonTree THEN56_tree=null;
        CommonTree ELSE57_tree=null;
        CommonTree IF58_tree=null;
        CommonTree OBRACKET59_tree=null;
        CommonTree CBRACKET61_tree=null;
        CommonTree THEN62_tree=null;
        RewriteRuleTokenStream stream_THEN = new RewriteRuleTokenStream(adaptor,"token THEN");
        RewriteRuleTokenStream stream_OBRACKET = new RewriteRuleTokenStream(adaptor,"token OBRACKET");
        RewriteRuleTokenStream stream_IF = new RewriteRuleTokenStream(adaptor,"token IF");
        RewriteRuleTokenStream stream_CBRACKET = new RewriteRuleTokenStream(adaptor,"token CBRACKET");
        RewriteRuleTokenStream stream_ELSE = new RewriteRuleTokenStream(adaptor,"token ELSE");
        RewriteRuleSubtreeStream stream_blockStmt = new RewriteRuleSubtreeStream(adaptor,"rule blockStmt");
        RewriteRuleSubtreeStream stream_expr = new RewriteRuleSubtreeStream(adaptor,"rule expr");
        try 
    	{
            // LPMEDParser.g:69:3: ( IF OBRACKET expr CBRACKET THEN th= blockStmt ELSE el= blockStmt -> ^( CIFTE expr $th $el) | IF OBRACKET expr CBRACKET THEN blockStmt -> ^( CIFTE expr blockStmt ) )
            int alt7 = 2;
            int LA7_0 = input.LA(1);

            if ( (LA7_0 == IF) )
            {
                int LA7_1 = input.LA(2);

                if ( (synpred1_LPMEDParser()) )
                {
                    alt7 = 1;
                }
                else if ( (true) )
                {
                    alt7 = 2;
                }
                else 
                {
                    if ( state.backtracking > 0 ) {state.failed = true; return retval;}
                    NoViableAltException nvae_d7s1 =
                        new NoViableAltException("", 7, 1, input);

                    throw nvae_d7s1;
                }
            }
            else 
            {
                if ( state.backtracking > 0 ) {state.failed = true; return retval;}
                NoViableAltException nvae_d7s0 =
                    new NoViableAltException("", 7, 0, input);

                throw nvae_d7s0;
            }
            switch (alt7) 
            {
                case 1 :
                    // LPMEDParser.g:70:4: IF OBRACKET expr CBRACKET THEN th= blockStmt ELSE el= blockStmt
                    {
                    	IF52=(IToken)Match(input,IF,FOLLOW_IF_in_ifStmt433); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_IF.Add(IF52);

                    	OBRACKET53=(IToken)Match(input,OBRACKET,FOLLOW_OBRACKET_in_ifStmt435); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_OBRACKET.Add(OBRACKET53);

                    	PushFollow(FOLLOW_expr_in_ifStmt437);
                    	expr54 = expr();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) stream_expr.Add(expr54.Tree);
                    	CBRACKET55=(IToken)Match(input,CBRACKET,FOLLOW_CBRACKET_in_ifStmt439); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_CBRACKET.Add(CBRACKET55);

                    	THEN56=(IToken)Match(input,THEN,FOLLOW_THEN_in_ifStmt441); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_THEN.Add(THEN56);

                    	PushFollow(FOLLOW_blockStmt_in_ifStmt445);
                    	th = blockStmt();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) stream_blockStmt.Add(th.Tree);
                    	ELSE57=(IToken)Match(input,ELSE,FOLLOW_ELSE_in_ifStmt447); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_ELSE.Add(ELSE57);

                    	PushFollow(FOLLOW_blockStmt_in_ifStmt451);
                    	el = blockStmt();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) stream_blockStmt.Add(el.Tree);


                    	// AST REWRITE
                    	// elements:          el, th, expr
                    	// token labels:      
                    	// rule labels:       retval, el, th
                    	// token list labels: 
                    	// rule list labels:  
                    	if ( state.backtracking==0 ) {
                    	retval.Tree = root_0;
                    	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));
                    	RewriteRuleSubtreeStream stream_el = new RewriteRuleSubtreeStream(adaptor, "token el", (el!=null ? el.Tree : null));
                    	RewriteRuleSubtreeStream stream_th = new RewriteRuleSubtreeStream(adaptor, "token th", (th!=null ? th.Tree : null));

                    	root_0 = (CommonTree)adaptor.GetNilNode();
                    	// 70:66: -> ^( CIFTE expr $th $el)
                    	{
                    	    // LPMEDParser.g:70:69: ^( CIFTE expr $th $el)
                    	    {
                    	    CommonTree root_1 = (CommonTree)adaptor.GetNilNode();
                    	    root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(CIFTE, "CIFTE"), root_1);

                    	    adaptor.AddChild(root_1, stream_expr.NextTree());
                    	    adaptor.AddChild(root_1, stream_th.NextTree());
                    	    adaptor.AddChild(root_1, stream_el.NextTree());

                    	    adaptor.AddChild(root_0, root_1);
                    	    }

                    	}

                    	retval.Tree = root_0;retval.Tree = root_0;}
                    }
                    break;
                case 2 :
                    // LPMEDParser.g:71:5: IF OBRACKET expr CBRACKET THEN blockStmt
                    {
                    	IF58=(IToken)Match(input,IF,FOLLOW_IF_in_ifStmt471); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_IF.Add(IF58);

                    	OBRACKET59=(IToken)Match(input,OBRACKET,FOLLOW_OBRACKET_in_ifStmt473); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_OBRACKET.Add(OBRACKET59);

                    	PushFollow(FOLLOW_expr_in_ifStmt475);
                    	expr60 = expr();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) stream_expr.Add(expr60.Tree);
                    	CBRACKET61=(IToken)Match(input,CBRACKET,FOLLOW_CBRACKET_in_ifStmt477); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_CBRACKET.Add(CBRACKET61);

                    	THEN62=(IToken)Match(input,THEN,FOLLOW_THEN_in_ifStmt479); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_THEN.Add(THEN62);

                    	PushFollow(FOLLOW_blockStmt_in_ifStmt481);
                    	blockStmt63 = blockStmt();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) stream_blockStmt.Add(blockStmt63.Tree);


                    	// AST REWRITE
                    	// elements:          blockStmt, expr
                    	// token labels:      
                    	// rule labels:       retval
                    	// token list labels: 
                    	// rule list labels:  
                    	if ( state.backtracking==0 ) {
                    	retval.Tree = root_0;
                    	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

                    	root_0 = (CommonTree)adaptor.GetNilNode();
                    	// 71:46: -> ^( CIFTE expr blockStmt )
                    	{
                    	    // LPMEDParser.g:71:49: ^( CIFTE expr blockStmt )
                    	    {
                    	    CommonTree root_1 = (CommonTree)adaptor.GetNilNode();
                    	    root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(CIFTE, "CIFTE"), root_1);

                    	    adaptor.AddChild(root_1, stream_expr.NextTree());
                    	    adaptor.AddChild(root_1, stream_blockStmt.NextTree());

                    	    adaptor.AddChild(root_0, root_1);
                    	    }

                    	}

                    	retval.Tree = root_0;retval.Tree = root_0;}
                    }
                    break;

            }
            retval.Stop = input.LT(-1);

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);}
        }
        catch (Exception e) 
        {
            Logger.Add(e); if (e is RecognitionException) Recover(input,(RecognitionException)e);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "ifStmt"

    public class assign_return : ParserRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "assign"
    // LPMEDParser.g:76:1: assign : ID EQUALS expr -> ^( CASSIGN ID expr ) ;
    public LPMEDParser.assign_return assign() // throws RecognitionException [1]
    {   
        LPMEDParser.assign_return retval = new LPMEDParser.assign_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        IToken ID64 = null;
        IToken EQUALS65 = null;
        LPMEDParser.expr_return expr66 = default(LPMEDParser.expr_return);


        CommonTree ID64_tree=null;
        CommonTree EQUALS65_tree=null;
        RewriteRuleTokenStream stream_EQUALS = new RewriteRuleTokenStream(adaptor,"token EQUALS");
        RewriteRuleTokenStream stream_ID = new RewriteRuleTokenStream(adaptor,"token ID");
        RewriteRuleSubtreeStream stream_expr = new RewriteRuleSubtreeStream(adaptor,"rule expr");
        try 
    	{
            // LPMEDParser.g:76:9: ( ID EQUALS expr -> ^( CASSIGN ID expr ) )
            // LPMEDParser.g:76:11: ID EQUALS expr
            {
            	ID64=(IToken)Match(input,ID,FOLLOW_ID_in_assign510); if (state.failed) return retval; 
            	if ( state.backtracking==0 ) stream_ID.Add(ID64);

            	EQUALS65=(IToken)Match(input,EQUALS,FOLLOW_EQUALS_in_assign512); if (state.failed) return retval; 
            	if ( state.backtracking==0 ) stream_EQUALS.Add(EQUALS65);

            	PushFollow(FOLLOW_expr_in_assign514);
            	expr66 = expr();
            	state.followingStackPointer--;
            	if (state.failed) return retval;
            	if ( state.backtracking==0 ) stream_expr.Add(expr66.Tree);


            	// AST REWRITE
            	// elements:          expr, ID
            	// token labels:      
            	// rule labels:       retval
            	// token list labels: 
            	// rule list labels:  
            	if ( state.backtracking==0 ) {
            	retval.Tree = root_0;
            	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

            	root_0 = (CommonTree)adaptor.GetNilNode();
            	// 76:25: -> ^( CASSIGN ID expr )
            	{
            	    // LPMEDParser.g:76:28: ^( CASSIGN ID expr )
            	    {
            	    CommonTree root_1 = (CommonTree)adaptor.GetNilNode();
            	    root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(CASSIGN, "CASSIGN"), root_1);

            	    adaptor.AddChild(root_1, stream_ID.NextNode());
            	    adaptor.AddChild(root_1, stream_expr.NextTree());

            	    adaptor.AddChild(root_0, root_1);
            	    }

            	}

            	retval.Tree = root_0;retval.Tree = root_0;}
            }

            retval.Stop = input.LT(-1);

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);}
        }
        catch (Exception e) 
        {
            Logger.Add(e); if (e is RecognitionException) Recover(input,(RecognitionException)e);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "assign"

    public class expr_return : ParserRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "expr"
    // LPMEDParser.g:80:1: expr : orExpr ;
    public LPMEDParser.expr_return expr() // throws RecognitionException [1]
    {   
        LPMEDParser.expr_return retval = new LPMEDParser.expr_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        LPMEDParser.orExpr_return orExpr67 = default(LPMEDParser.orExpr_return);



        try 
    	{
            // LPMEDParser.g:81:4: ( orExpr )
            // LPMEDParser.g:81:6: orExpr
            {
            	root_0 = (CommonTree)adaptor.GetNilNode();

            	PushFollow(FOLLOW_orExpr_in_expr543);
            	orExpr67 = orExpr();
            	state.followingStackPointer--;
            	if (state.failed) return retval;
            	if ( state.backtracking == 0 ) adaptor.AddChild(root_0, orExpr67.Tree);

            }

            retval.Stop = input.LT(-1);

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);}
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
    	// Conversion of the second argument necessary, but harmless
    	retval.Tree = (CommonTree)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "expr"

    public class orExpr_return : ParserRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "orExpr"
    // LPMEDParser.g:82:1: orExpr : andExpr ( OpOr andExpr )* ;
    public LPMEDParser.orExpr_return orExpr() // throws RecognitionException [1]
    {   
        LPMEDParser.orExpr_return retval = new LPMEDParser.orExpr_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        IToken OpOr69 = null;
        LPMEDParser.andExpr_return andExpr68 = default(LPMEDParser.andExpr_return);

        LPMEDParser.andExpr_return andExpr70 = default(LPMEDParser.andExpr_return);


        CommonTree OpOr69_tree=null;

        try 
    	{
            // LPMEDParser.g:82:11: ( andExpr ( OpOr andExpr )* )
            // LPMEDParser.g:82:13: andExpr ( OpOr andExpr )*
            {
            	root_0 = (CommonTree)adaptor.GetNilNode();

            	PushFollow(FOLLOW_andExpr_in_orExpr553);
            	andExpr68 = andExpr();
            	state.followingStackPointer--;
            	if (state.failed) return retval;
            	if ( state.backtracking == 0 ) adaptor.AddChild(root_0, andExpr68.Tree);
            	// LPMEDParser.g:82:21: ( OpOr andExpr )*
            	do 
            	{
            	    int alt8 = 2;
            	    int LA8_0 = input.LA(1);

            	    if ( (LA8_0 == OpOr) )
            	    {
            	        alt8 = 1;
            	    }


            	    switch (alt8) 
            		{
            			case 1 :
            			    // LPMEDParser.g:82:22: OpOr andExpr
            			    {
            			    	OpOr69=(IToken)Match(input,OpOr,FOLLOW_OpOr_in_orExpr556); if (state.failed) return retval;
            			    	if ( state.backtracking == 0 )
            			    	{OpOr69_tree = (CommonTree)adaptor.Create(OpOr69);
            			    		root_0 = (CommonTree)adaptor.BecomeRoot(OpOr69_tree, root_0);
            			    	}
            			    	PushFollow(FOLLOW_andExpr_in_orExpr559);
            			    	andExpr70 = andExpr();
            			    	state.followingStackPointer--;
            			    	if (state.failed) return retval;
            			    	if ( state.backtracking == 0 ) adaptor.AddChild(root_0, andExpr70.Tree);

            			    }
            			    break;

            			default:
            			    goto loop8;
            	    }
            	} while (true);

            	loop8:
            		;	// Stops C# compiler whining that label 'loop8' has no statements


            }

            retval.Stop = input.LT(-1);

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);}
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
    	// Conversion of the second argument necessary, but harmless
    	retval.Tree = (CommonTree)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "orExpr"

    public class andExpr_return : ParserRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "andExpr"
    // LPMEDParser.g:83:1: andExpr : equalityExpr ( OpAnd equalityExpr )* ;
    public LPMEDParser.andExpr_return andExpr() // throws RecognitionException [1]
    {   
        LPMEDParser.andExpr_return retval = new LPMEDParser.andExpr_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        IToken OpAnd72 = null;
        LPMEDParser.equalityExpr_return equalityExpr71 = default(LPMEDParser.equalityExpr_return);

        LPMEDParser.equalityExpr_return equalityExpr73 = default(LPMEDParser.equalityExpr_return);


        CommonTree OpAnd72_tree=null;

        try 
    	{
            // LPMEDParser.g:83:11: ( equalityExpr ( OpAnd equalityExpr )* )
            // LPMEDParser.g:83:13: equalityExpr ( OpAnd equalityExpr )*
            {
            	root_0 = (CommonTree)adaptor.GetNilNode();

            	PushFollow(FOLLOW_equalityExpr_in_andExpr570);
            	equalityExpr71 = equalityExpr();
            	state.followingStackPointer--;
            	if (state.failed) return retval;
            	if ( state.backtracking == 0 ) adaptor.AddChild(root_0, equalityExpr71.Tree);
            	// LPMEDParser.g:83:26: ( OpAnd equalityExpr )*
            	do 
            	{
            	    int alt9 = 2;
            	    int LA9_0 = input.LA(1);

            	    if ( (LA9_0 == OpAnd) )
            	    {
            	        alt9 = 1;
            	    }


            	    switch (alt9) 
            		{
            			case 1 :
            			    // LPMEDParser.g:83:27: OpAnd equalityExpr
            			    {
            			    	OpAnd72=(IToken)Match(input,OpAnd,FOLLOW_OpAnd_in_andExpr573); if (state.failed) return retval;
            			    	if ( state.backtracking == 0 )
            			    	{OpAnd72_tree = (CommonTree)adaptor.Create(OpAnd72);
            			    		root_0 = (CommonTree)adaptor.BecomeRoot(OpAnd72_tree, root_0);
            			    	}
            			    	PushFollow(FOLLOW_equalityExpr_in_andExpr576);
            			    	equalityExpr73 = equalityExpr();
            			    	state.followingStackPointer--;
            			    	if (state.failed) return retval;
            			    	if ( state.backtracking == 0 ) adaptor.AddChild(root_0, equalityExpr73.Tree);

            			    }
            			    break;

            			default:
            			    goto loop9;
            	    }
            	} while (true);

            	loop9:
            		;	// Stops C# compiler whining that label 'loop9' has no statements


            }

            retval.Stop = input.LT(-1);

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);}
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
    	// Conversion of the second argument necessary, but harmless
    	retval.Tree = (CommonTree)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "andExpr"

    public class equalityExpr_return : ParserRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "equalityExpr"
    // LPMEDParser.g:84:1: equalityExpr : comparisonExpr ( OpLogicalB comparisonExpr )* ;
    public LPMEDParser.equalityExpr_return equalityExpr() // throws RecognitionException [1]
    {   
        LPMEDParser.equalityExpr_return retval = new LPMEDParser.equalityExpr_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        IToken OpLogicalB75 = null;
        LPMEDParser.comparisonExpr_return comparisonExpr74 = default(LPMEDParser.comparisonExpr_return);

        LPMEDParser.comparisonExpr_return comparisonExpr76 = default(LPMEDParser.comparisonExpr_return);


        CommonTree OpLogicalB75_tree=null;

        try 
    	{
            // LPMEDParser.g:84:15: ( comparisonExpr ( OpLogicalB comparisonExpr )* )
            // LPMEDParser.g:84:17: comparisonExpr ( OpLogicalB comparisonExpr )*
            {
            	root_0 = (CommonTree)adaptor.GetNilNode();

            	PushFollow(FOLLOW_comparisonExpr_in_equalityExpr587);
            	comparisonExpr74 = comparisonExpr();
            	state.followingStackPointer--;
            	if (state.failed) return retval;
            	if ( state.backtracking == 0 ) adaptor.AddChild(root_0, comparisonExpr74.Tree);
            	// LPMEDParser.g:84:32: ( OpLogicalB comparisonExpr )*
            	do 
            	{
            	    int alt10 = 2;
            	    int LA10_0 = input.LA(1);

            	    if ( (LA10_0 == OpLogicalB) )
            	    {
            	        alt10 = 1;
            	    }


            	    switch (alt10) 
            		{
            			case 1 :
            			    // LPMEDParser.g:84:33: OpLogicalB comparisonExpr
            			    {
            			    	OpLogicalB75=(IToken)Match(input,OpLogicalB,FOLLOW_OpLogicalB_in_equalityExpr590); if (state.failed) return retval;
            			    	if ( state.backtracking == 0 )
            			    	{OpLogicalB75_tree = (CommonTree)adaptor.Create(OpLogicalB75);
            			    		root_0 = (CommonTree)adaptor.BecomeRoot(OpLogicalB75_tree, root_0);
            			    	}
            			    	PushFollow(FOLLOW_comparisonExpr_in_equalityExpr593);
            			    	comparisonExpr76 = comparisonExpr();
            			    	state.followingStackPointer--;
            			    	if (state.failed) return retval;
            			    	if ( state.backtracking == 0 ) adaptor.AddChild(root_0, comparisonExpr76.Tree);

            			    }
            			    break;

            			default:
            			    goto loop10;
            	    }
            	} while (true);

            	loop10:
            		;	// Stops C# compiler whining that label 'loop10' has no statements


            }

            retval.Stop = input.LT(-1);

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);}
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
    	// Conversion of the second argument necessary, but harmless
    	retval.Tree = (CommonTree)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "equalityExpr"

    public class comparisonExpr_return : ParserRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "comparisonExpr"
    // LPMEDParser.g:85:1: comparisonExpr : additiveExpr ( OpLogicalA additiveExpr )* ;
    public LPMEDParser.comparisonExpr_return comparisonExpr() // throws RecognitionException [1]
    {   
        LPMEDParser.comparisonExpr_return retval = new LPMEDParser.comparisonExpr_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        IToken OpLogicalA78 = null;
        LPMEDParser.additiveExpr_return additiveExpr77 = default(LPMEDParser.additiveExpr_return);

        LPMEDParser.additiveExpr_return additiveExpr79 = default(LPMEDParser.additiveExpr_return);


        CommonTree OpLogicalA78_tree=null;

        try 
    	{
            // LPMEDParser.g:85:17: ( additiveExpr ( OpLogicalA additiveExpr )* )
            // LPMEDParser.g:85:19: additiveExpr ( OpLogicalA additiveExpr )*
            {
            	root_0 = (CommonTree)adaptor.GetNilNode();

            	PushFollow(FOLLOW_additiveExpr_in_comparisonExpr604);
            	additiveExpr77 = additiveExpr();
            	state.followingStackPointer--;
            	if (state.failed) return retval;
            	if ( state.backtracking == 0 ) adaptor.AddChild(root_0, additiveExpr77.Tree);
            	// LPMEDParser.g:85:32: ( OpLogicalA additiveExpr )*
            	do 
            	{
            	    int alt11 = 2;
            	    int LA11_0 = input.LA(1);

            	    if ( (LA11_0 == OpLogicalA) )
            	    {
            	        alt11 = 1;
            	    }


            	    switch (alt11) 
            		{
            			case 1 :
            			    // LPMEDParser.g:85:33: OpLogicalA additiveExpr
            			    {
            			    	OpLogicalA78=(IToken)Match(input,OpLogicalA,FOLLOW_OpLogicalA_in_comparisonExpr607); if (state.failed) return retval;
            			    	if ( state.backtracking == 0 )
            			    	{OpLogicalA78_tree = (CommonTree)adaptor.Create(OpLogicalA78);
            			    		root_0 = (CommonTree)adaptor.BecomeRoot(OpLogicalA78_tree, root_0);
            			    	}
            			    	PushFollow(FOLLOW_additiveExpr_in_comparisonExpr610);
            			    	additiveExpr79 = additiveExpr();
            			    	state.followingStackPointer--;
            			    	if (state.failed) return retval;
            			    	if ( state.backtracking == 0 ) adaptor.AddChild(root_0, additiveExpr79.Tree);

            			    }
            			    break;

            			default:
            			    goto loop11;
            	    }
            	} while (true);

            	loop11:
            		;	// Stops C# compiler whining that label 'loop11' has no statements


            }

            retval.Stop = input.LT(-1);

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);}
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
    	// Conversion of the second argument necessary, but harmless
    	retval.Tree = (CommonTree)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "comparisonExpr"

    public class additiveExpr_return : ParserRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "additiveExpr"
    // LPMEDParser.g:86:1: additiveExpr : multiplicativeExpr ( OpAddSub multiplicativeExpr )* ;
    public LPMEDParser.additiveExpr_return additiveExpr() // throws RecognitionException [1]
    {   
        LPMEDParser.additiveExpr_return retval = new LPMEDParser.additiveExpr_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        IToken OpAddSub81 = null;
        LPMEDParser.multiplicativeExpr_return multiplicativeExpr80 = default(LPMEDParser.multiplicativeExpr_return);

        LPMEDParser.multiplicativeExpr_return multiplicativeExpr82 = default(LPMEDParser.multiplicativeExpr_return);


        CommonTree OpAddSub81_tree=null;

        try 
    	{
            // LPMEDParser.g:86:15: ( multiplicativeExpr ( OpAddSub multiplicativeExpr )* )
            // LPMEDParser.g:86:17: multiplicativeExpr ( OpAddSub multiplicativeExpr )*
            {
            	root_0 = (CommonTree)adaptor.GetNilNode();

            	PushFollow(FOLLOW_multiplicativeExpr_in_additiveExpr621);
            	multiplicativeExpr80 = multiplicativeExpr();
            	state.followingStackPointer--;
            	if (state.failed) return retval;
            	if ( state.backtracking == 0 ) adaptor.AddChild(root_0, multiplicativeExpr80.Tree);
            	// LPMEDParser.g:86:36: ( OpAddSub multiplicativeExpr )*
            	do 
            	{
            	    int alt12 = 2;
            	    int LA12_0 = input.LA(1);

            	    if ( (LA12_0 == OpAddSub) )
            	    {
            	        alt12 = 1;
            	    }


            	    switch (alt12) 
            		{
            			case 1 :
            			    // LPMEDParser.g:86:37: OpAddSub multiplicativeExpr
            			    {
            			    	OpAddSub81=(IToken)Match(input,OpAddSub,FOLLOW_OpAddSub_in_additiveExpr624); if (state.failed) return retval;
            			    	if ( state.backtracking == 0 )
            			    	{OpAddSub81_tree = (CommonTree)adaptor.Create(OpAddSub81);
            			    		root_0 = (CommonTree)adaptor.BecomeRoot(OpAddSub81_tree, root_0);
            			    	}
            			    	PushFollow(FOLLOW_multiplicativeExpr_in_additiveExpr627);
            			    	multiplicativeExpr82 = multiplicativeExpr();
            			    	state.followingStackPointer--;
            			    	if (state.failed) return retval;
            			    	if ( state.backtracking == 0 ) adaptor.AddChild(root_0, multiplicativeExpr82.Tree);

            			    }
            			    break;

            			default:
            			    goto loop12;
            	    }
            	} while (true);

            	loop12:
            		;	// Stops C# compiler whining that label 'loop12' has no statements


            }

            retval.Stop = input.LT(-1);

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);}
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
    	// Conversion of the second argument necessary, but harmless
    	retval.Tree = (CommonTree)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "additiveExpr"

    public class multiplicativeExpr_return : ParserRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "multiplicativeExpr"
    // LPMEDParser.g:87:1: multiplicativeExpr : notExpr ( OpDivMul notExpr )* ;
    public LPMEDParser.multiplicativeExpr_return multiplicativeExpr() // throws RecognitionException [1]
    {   
        LPMEDParser.multiplicativeExpr_return retval = new LPMEDParser.multiplicativeExpr_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        IToken OpDivMul84 = null;
        LPMEDParser.notExpr_return notExpr83 = default(LPMEDParser.notExpr_return);

        LPMEDParser.notExpr_return notExpr85 = default(LPMEDParser.notExpr_return);


        CommonTree OpDivMul84_tree=null;

        try 
    	{
            // LPMEDParser.g:87:20: ( notExpr ( OpDivMul notExpr )* )
            // LPMEDParser.g:87:22: notExpr ( OpDivMul notExpr )*
            {
            	root_0 = (CommonTree)adaptor.GetNilNode();

            	PushFollow(FOLLOW_notExpr_in_multiplicativeExpr637);
            	notExpr83 = notExpr();
            	state.followingStackPointer--;
            	if (state.failed) return retval;
            	if ( state.backtracking == 0 ) adaptor.AddChild(root_0, notExpr83.Tree);
            	// LPMEDParser.g:87:30: ( OpDivMul notExpr )*
            	do 
            	{
            	    int alt13 = 2;
            	    int LA13_0 = input.LA(1);

            	    if ( (LA13_0 == OpDivMul) )
            	    {
            	        alt13 = 1;
            	    }


            	    switch (alt13) 
            		{
            			case 1 :
            			    // LPMEDParser.g:87:31: OpDivMul notExpr
            			    {
            			    	OpDivMul84=(IToken)Match(input,OpDivMul,FOLLOW_OpDivMul_in_multiplicativeExpr640); if (state.failed) return retval;
            			    	if ( state.backtracking == 0 )
            			    	{OpDivMul84_tree = (CommonTree)adaptor.Create(OpDivMul84);
            			    		root_0 = (CommonTree)adaptor.BecomeRoot(OpDivMul84_tree, root_0);
            			    	}
            			    	PushFollow(FOLLOW_notExpr_in_multiplicativeExpr643);
            			    	notExpr85 = notExpr();
            			    	state.followingStackPointer--;
            			    	if (state.failed) return retval;
            			    	if ( state.backtracking == 0 ) adaptor.AddChild(root_0, notExpr85.Tree);

            			    }
            			    break;

            			default:
            			    goto loop13;
            	    }
            	} while (true);

            	loop13:
            		;	// Stops C# compiler whining that label 'loop13' has no statements


            }

            retval.Stop = input.LT(-1);

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);}
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
    	// Conversion of the second argument necessary, but harmless
    	retval.Tree = (CommonTree)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "multiplicativeExpr"

    public class notExpr_return : ParserRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "notExpr"
    // LPMEDParser.g:88:1: notExpr : ( ( OpUnar primary ) | primary );
    public LPMEDParser.notExpr_return notExpr() // throws RecognitionException [1]
    {   
        LPMEDParser.notExpr_return retval = new LPMEDParser.notExpr_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        IToken OpUnar86 = null;
        LPMEDParser.primary_return primary87 = default(LPMEDParser.primary_return);

        LPMEDParser.primary_return primary88 = default(LPMEDParser.primary_return);


        CommonTree OpUnar86_tree=null;

        try 
    	{
            // LPMEDParser.g:88:11: ( ( OpUnar primary ) | primary )
            int alt14 = 2;
            int LA14_0 = input.LA(1);

            if ( (LA14_0 == OpUnar) )
            {
                alt14 = 1;
            }
            else if ( (LA14_0 == DBOOL || (LA14_0 >= INT && LA14_0 <= FLOAT) || (LA14_0 >= ID && LA14_0 <= OBRACKET)) )
            {
                alt14 = 2;
            }
            else 
            {
                if ( state.backtracking > 0 ) {state.failed = true; return retval;}
                NoViableAltException nvae_d14s0 =
                    new NoViableAltException("", 14, 0, input);

                throw nvae_d14s0;
            }
            switch (alt14) 
            {
                case 1 :
                    // LPMEDParser.g:89:5: ( OpUnar primary )
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	// LPMEDParser.g:89:5: ( OpUnar primary )
                    	// LPMEDParser.g:89:6: OpUnar primary
                    	{
                    		OpUnar86=(IToken)Match(input,OpUnar,FOLLOW_OpUnar_in_notExpr659); if (state.failed) return retval;
                    		if ( state.backtracking == 0 )
                    		{OpUnar86_tree = (CommonTree)adaptor.Create(OpUnar86);
                    			root_0 = (CommonTree)adaptor.BecomeRoot(OpUnar86_tree, root_0);
                    		}
                    		PushFollow(FOLLOW_primary_in_notExpr662);
                    		primary87 = primary();
                    		state.followingStackPointer--;
                    		if (state.failed) return retval;
                    		if ( state.backtracking == 0 ) adaptor.AddChild(root_0, primary87.Tree);

                    	}


                    }
                    break;
                case 2 :
                    // LPMEDParser.g:90:6: primary
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	PushFollow(FOLLOW_primary_in_notExpr670);
                    	primary88 = primary();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking == 0 ) adaptor.AddChild(root_0, primary88.Tree);

                    }
                    break;

            }
            retval.Stop = input.LT(-1);

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);}
        }
        catch (Exception e) 
        {
            Logger.Add(e); if (e is RecognitionException) Recover(input,(RecognitionException)e);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "notExpr"

    public class primary_return : ParserRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "primary"
    // LPMEDParser.g:102:1: primary : ( atom | OBRACKET expr CBRACKET -> expr );
    public LPMEDParser.primary_return primary() // throws RecognitionException [1]
    {   
        LPMEDParser.primary_return retval = new LPMEDParser.primary_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        IToken OBRACKET90 = null;
        IToken CBRACKET92 = null;
        LPMEDParser.atom_return atom89 = default(LPMEDParser.atom_return);

        LPMEDParser.expr_return expr91 = default(LPMEDParser.expr_return);


        CommonTree OBRACKET90_tree=null;
        CommonTree CBRACKET92_tree=null;
        RewriteRuleTokenStream stream_OBRACKET = new RewriteRuleTokenStream(adaptor,"token OBRACKET");
        RewriteRuleTokenStream stream_CBRACKET = new RewriteRuleTokenStream(adaptor,"token CBRACKET");
        RewriteRuleSubtreeStream stream_expr = new RewriteRuleSubtreeStream(adaptor,"rule expr");
        try 
    	{
            // LPMEDParser.g:102:11: ( atom | OBRACKET expr CBRACKET -> expr )
            int alt15 = 2;
            int LA15_0 = input.LA(1);

            if ( (LA15_0 == DBOOL || (LA15_0 >= INT && LA15_0 <= FLOAT) || LA15_0 == ID) )
            {
                alt15 = 1;
            }
            else if ( (LA15_0 == OBRACKET) )
            {
                alt15 = 2;
            }
            else 
            {
                if ( state.backtracking > 0 ) {state.failed = true; return retval;}
                NoViableAltException nvae_d15s0 =
                    new NoViableAltException("", 15, 0, input);

                throw nvae_d15s0;
            }
            switch (alt15) 
            {
                case 1 :
                    // LPMEDParser.g:103:5: atom
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	PushFollow(FOLLOW_atom_in_primary698);
                    	atom89 = atom();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking == 0 ) adaptor.AddChild(root_0, atom89.Tree);

                    }
                    break;
                case 2 :
                    // LPMEDParser.g:104:6: OBRACKET expr CBRACKET
                    {
                    	OBRACKET90=(IToken)Match(input,OBRACKET,FOLLOW_OBRACKET_in_primary705); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_OBRACKET.Add(OBRACKET90);

                    	PushFollow(FOLLOW_expr_in_primary707);
                    	expr91 = expr();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) stream_expr.Add(expr91.Tree);
                    	CBRACKET92=(IToken)Match(input,CBRACKET,FOLLOW_CBRACKET_in_primary709); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_CBRACKET.Add(CBRACKET92);



                    	// AST REWRITE
                    	// elements:          expr
                    	// token labels:      
                    	// rule labels:       retval
                    	// token list labels: 
                    	// rule list labels:  
                    	if ( state.backtracking==0 ) {
                    	retval.Tree = root_0;
                    	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

                    	root_0 = (CommonTree)adaptor.GetNilNode();
                    	// 104:29: -> expr
                    	{
                    	    adaptor.AddChild(root_0, stream_expr.NextTree());

                    	}

                    	retval.Tree = root_0;retval.Tree = root_0;}
                    }
                    break;

            }
            retval.Stop = input.LT(-1);

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);}
        }
        catch (Exception e) 
        {
            Logger.Add(e); if (e is RecognitionException) Recover(input,(RecognitionException)e);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "primary"

    public class atom_return : ParserRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "atom"
    // LPMEDParser.g:109:1: atom options {backtrack=true; } : ( ID -> ID | FLOAT -> ^( CFLOAT FLOAT ) | INT -> ^( CINT INT ) | DBOOL -> ^( CBOOL DBOOL ) | qualifiedName | name= ID ( DOT nodes+= ID )+ DOT STATE -> ^( CGETSTATE ^( OBJECTNAME $name) ^( NODES ( $nodes)* ) ) );
    public LPMEDParser.atom_return atom() // throws RecognitionException [1]
    {   
        LPMEDParser.atom_return retval = new LPMEDParser.atom_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        IToken name = null;
        IToken ID93 = null;
        IToken FLOAT94 = null;
        IToken INT95 = null;
        IToken DBOOL96 = null;
        IToken DOT98 = null;
        IToken DOT99 = null;
        IToken STATE100 = null;
        IToken nodes = null;
        IList list_nodes = null;
        LPMEDParser.qualifiedName_return qualifiedName97 = default(LPMEDParser.qualifiedName_return);


        CommonTree name_tree=null;
        CommonTree ID93_tree=null;
        CommonTree FLOAT94_tree=null;
        CommonTree INT95_tree=null;
        CommonTree DBOOL96_tree=null;
        CommonTree DOT98_tree=null;
        CommonTree DOT99_tree=null;
        CommonTree STATE100_tree=null;
        CommonTree nodes_tree=null;
        RewriteRuleTokenStream stream_DBOOL = new RewriteRuleTokenStream(adaptor,"token DBOOL");
        RewriteRuleTokenStream stream_STATE = new RewriteRuleTokenStream(adaptor,"token STATE");
        RewriteRuleTokenStream stream_INT = new RewriteRuleTokenStream(adaptor,"token INT");
        RewriteRuleTokenStream stream_FLOAT = new RewriteRuleTokenStream(adaptor,"token FLOAT");
        RewriteRuleTokenStream stream_DOT = new RewriteRuleTokenStream(adaptor,"token DOT");
        RewriteRuleTokenStream stream_ID = new RewriteRuleTokenStream(adaptor,"token ID");

        try 
    	{
            // LPMEDParser.g:114:1: ( ID -> ID | FLOAT -> ^( CFLOAT FLOAT ) | INT -> ^( CINT INT ) | DBOOL -> ^( CBOOL DBOOL ) | qualifiedName | name= ID ( DOT nodes+= ID )+ DOT STATE -> ^( CGETSTATE ^( OBJECTNAME $name) ^( NODES ( $nodes)* ) ) )
            int alt17 = 6;
            alt17 = dfa17.Predict(input);
            switch (alt17) 
            {
                case 1 :
                    // LPMEDParser.g:114:4: ID
                    {
                    	ID93=(IToken)Match(input,ID,FOLLOW_ID_in_atom744); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_ID.Add(ID93);



                    	// AST REWRITE
                    	// elements:          ID
                    	// token labels:      
                    	// rule labels:       retval
                    	// token list labels: 
                    	// rule list labels:  
                    	if ( state.backtracking==0 ) {
                    	retval.Tree = root_0;
                    	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

                    	root_0 = (CommonTree)adaptor.GetNilNode();
                    	// 114:7: -> ID
                    	{
                    	    adaptor.AddChild(root_0, stream_ID.NextNode());

                    	}

                    	retval.Tree = root_0;retval.Tree = root_0;}
                    }
                    break;
                case 2 :
                    // LPMEDParser.g:115:4: FLOAT
                    {
                    	FLOAT94=(IToken)Match(input,FLOAT,FOLLOW_FLOAT_in_atom753); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_FLOAT.Add(FLOAT94);



                    	// AST REWRITE
                    	// elements:          FLOAT
                    	// token labels:      
                    	// rule labels:       retval
                    	// token list labels: 
                    	// rule list labels:  
                    	if ( state.backtracking==0 ) {
                    	retval.Tree = root_0;
                    	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

                    	root_0 = (CommonTree)adaptor.GetNilNode();
                    	// 115:10: -> ^( CFLOAT FLOAT )
                    	{
                    	    // LPMEDParser.g:115:13: ^( CFLOAT FLOAT )
                    	    {
                    	    CommonTree root_1 = (CommonTree)adaptor.GetNilNode();
                    	    root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(CFLOAT, "CFLOAT"), root_1);

                    	    adaptor.AddChild(root_1, stream_FLOAT.NextNode());

                    	    adaptor.AddChild(root_0, root_1);
                    	    }

                    	}

                    	retval.Tree = root_0;retval.Tree = root_0;}
                    }
                    break;
                case 3 :
                    // LPMEDParser.g:116:5: INT
                    {
                    	INT95=(IToken)Match(input,INT,FOLLOW_INT_in_atom767); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_INT.Add(INT95);



                    	// AST REWRITE
                    	// elements:          INT
                    	// token labels:      
                    	// rule labels:       retval
                    	// token list labels: 
                    	// rule list labels:  
                    	if ( state.backtracking==0 ) {
                    	retval.Tree = root_0;
                    	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

                    	root_0 = (CommonTree)adaptor.GetNilNode();
                    	// 116:9: -> ^( CINT INT )
                    	{
                    	    // LPMEDParser.g:116:12: ^( CINT INT )
                    	    {
                    	    CommonTree root_1 = (CommonTree)adaptor.GetNilNode();
                    	    root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(CINT, "CINT"), root_1);

                    	    adaptor.AddChild(root_1, stream_INT.NextNode());

                    	    adaptor.AddChild(root_0, root_1);
                    	    }

                    	}

                    	retval.Tree = root_0;retval.Tree = root_0;}
                    }
                    break;
                case 4 :
                    // LPMEDParser.g:117:4: DBOOL
                    {
                    	DBOOL96=(IToken)Match(input,DBOOL,FOLLOW_DBOOL_in_atom780); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_DBOOL.Add(DBOOL96);



                    	// AST REWRITE
                    	// elements:          DBOOL
                    	// token labels:      
                    	// rule labels:       retval
                    	// token list labels: 
                    	// rule list labels:  
                    	if ( state.backtracking==0 ) {
                    	retval.Tree = root_0;
                    	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

                    	root_0 = (CommonTree)adaptor.GetNilNode();
                    	// 117:10: -> ^( CBOOL DBOOL )
                    	{
                    	    // LPMEDParser.g:117:13: ^( CBOOL DBOOL )
                    	    {
                    	    CommonTree root_1 = (CommonTree)adaptor.GetNilNode();
                    	    root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(CBOOL, "CBOOL"), root_1);

                    	    adaptor.AddChild(root_1, stream_DBOOL.NextNode());

                    	    adaptor.AddChild(root_0, root_1);
                    	    }

                    	}

                    	retval.Tree = root_0;retval.Tree = root_0;}
                    }
                    break;
                case 5 :
                    // LPMEDParser.g:118:4: qualifiedName
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	PushFollow(FOLLOW_qualifiedName_in_atom793);
                    	qualifiedName97 = qualifiedName();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking == 0 ) adaptor.AddChild(root_0, qualifiedName97.Tree);

                    }
                    break;
                case 6 :
                    // LPMEDParser.g:119:4: name= ID ( DOT nodes+= ID )+ DOT STATE
                    {
                    	name=(IToken)Match(input,ID,FOLLOW_ID_in_atom800); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_ID.Add(name);

                    	// LPMEDParser.g:119:12: ( DOT nodes+= ID )+
                    	int cnt16 = 0;
                    	do 
                    	{
                    	    int alt16 = 2;
                    	    int LA16_0 = input.LA(1);

                    	    if ( (LA16_0 == DOT) )
                    	    {
                    	        int LA16_1 = input.LA(2);

                    	        if ( (LA16_1 == ID) )
                    	        {
                    	            alt16 = 1;
                    	        }


                    	    }


                    	    switch (alt16) 
                    		{
                    			case 1 :
                    			    // LPMEDParser.g:119:13: DOT nodes+= ID
                    			    {
                    			    	DOT98=(IToken)Match(input,DOT,FOLLOW_DOT_in_atom803); if (state.failed) return retval; 
                    			    	if ( state.backtracking==0 ) stream_DOT.Add(DOT98);

                    			    	nodes=(IToken)Match(input,ID,FOLLOW_ID_in_atom807); if (state.failed) return retval; 
                    			    	if ( state.backtracking==0 ) stream_ID.Add(nodes);

                    			    	if (list_nodes == null) list_nodes = new ArrayList();
                    			    	list_nodes.Add(nodes);


                    			    }
                    			    break;

                    			default:
                    			    if ( cnt16 >= 1 ) goto loop16;
                    			    if ( state.backtracking > 0 ) {state.failed = true; return retval;}
                    		            EarlyExitException eee =
                    		                new EarlyExitException(16, input);
                    		            throw eee;
                    	    }
                    	    cnt16++;
                    	} while (true);

                    	loop16:
                    		;	// Stops C# compiler whinging that label 'loop16' has no statements

                    	DOT99=(IToken)Match(input,DOT,FOLLOW_DOT_in_atom812); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_DOT.Add(DOT99);

                    	STATE100=(IToken)Match(input,STATE,FOLLOW_STATE_in_atom814); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_STATE.Add(STATE100);



                    	// AST REWRITE
                    	// elements:          name, nodes
                    	// token labels:      name
                    	// rule labels:       retval
                    	// token list labels: nodes
                    	// rule list labels:  
                    	if ( state.backtracking==0 ) {
                    	retval.Tree = root_0;
                    	RewriteRuleTokenStream stream_name = new RewriteRuleTokenStream(adaptor, "token name", name);
                    	RewriteRuleTokenStream stream_nodes = new RewriteRuleTokenStream(adaptor,"token nodes", list_nodes);
                    	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

                    	root_0 = (CommonTree)adaptor.GetNilNode();
                    	// 119:40: -> ^( CGETSTATE ^( OBJECTNAME $name) ^( NODES ( $nodes)* ) )
                    	{
                    	    // LPMEDParser.g:119:43: ^( CGETSTATE ^( OBJECTNAME $name) ^( NODES ( $nodes)* ) )
                    	    {
                    	    CommonTree root_1 = (CommonTree)adaptor.GetNilNode();
                    	    root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(CGETSTATE, "CGETSTATE"), root_1);

                    	    // LPMEDParser.g:119:55: ^( OBJECTNAME $name)
                    	    {
                    	    CommonTree root_2 = (CommonTree)adaptor.GetNilNode();
                    	    root_2 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(OBJECTNAME, "OBJECTNAME"), root_2);

                    	    adaptor.AddChild(root_2, stream_name.NextNode());

                    	    adaptor.AddChild(root_1, root_2);
                    	    }
                    	    // LPMEDParser.g:119:75: ^( NODES ( $nodes)* )
                    	    {
                    	    CommonTree root_2 = (CommonTree)adaptor.GetNilNode();
                    	    root_2 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(NODES, "NODES"), root_2);

                    	    // LPMEDParser.g:119:83: ( $nodes)*
                    	    while ( stream_nodes.HasNext() )
                    	    {
                    	        adaptor.AddChild(root_2, stream_nodes.NextNode());

                    	    }
                    	    stream_nodes.Reset();

                    	    adaptor.AddChild(root_1, root_2);
                    	    }

                    	    adaptor.AddChild(root_0, root_1);
                    	    }

                    	}

                    	retval.Tree = root_0;retval.Tree = root_0;}
                    }
                    break;

            }
            retval.Stop = input.LT(-1);

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);}
        }
        catch (Exception e) 
        {
            Logger.Add(e); if (e is RecognitionException) Recover(input,(RecognitionException)e);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "atom"

    public class qualifiedName_return : ParserRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "qualifiedName"
    // LPMEDParser.g:123:1: qualifiedName : name= ID ( DOT nodes+= ID )+ DOT sm= ID -> ^( OBJECTNAME $name) ^( NODES ( $nodes)* ) ^( MEMBERNAME $sm) ;
    public LPMEDParser.qualifiedName_return qualifiedName() // throws RecognitionException [1]
    {   
        LPMEDParser.qualifiedName_return retval = new LPMEDParser.qualifiedName_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        IToken name = null;
        IToken sm = null;
        IToken DOT101 = null;
        IToken DOT102 = null;
        IToken nodes = null;
        IList list_nodes = null;

        CommonTree name_tree=null;
        CommonTree sm_tree=null;
        CommonTree DOT101_tree=null;
        CommonTree DOT102_tree=null;
        CommonTree nodes_tree=null;
        RewriteRuleTokenStream stream_ID = new RewriteRuleTokenStream(adaptor,"token ID");
        RewriteRuleTokenStream stream_DOT = new RewriteRuleTokenStream(adaptor,"token DOT");

        try 
    	{
            // LPMEDParser.g:123:15: (name= ID ( DOT nodes+= ID )+ DOT sm= ID -> ^( OBJECTNAME $name) ^( NODES ( $nodes)* ) ^( MEMBERNAME $sm) )
            // LPMEDParser.g:124:2: name= ID ( DOT nodes+= ID )+ DOT sm= ID
            {
            	name=(IToken)Match(input,ID,FOLLOW_ID_in_qualifiedName853); if (state.failed) return retval; 
            	if ( state.backtracking==0 ) stream_ID.Add(name);

            	// LPMEDParser.g:124:10: ( DOT nodes+= ID )+
            	int cnt18 = 0;
            	do 
            	{
            	    int alt18 = 2;
            	    int LA18_0 = input.LA(1);

            	    if ( (LA18_0 == DOT) )
            	    {
            	        int LA18_1 = input.LA(2);

            	        if ( (LA18_1 == ID) )
            	        {
            	            int LA18_2 = input.LA(3);

            	            if ( (LA18_2 == DOT) )
            	            {
            	                int LA18_4 = input.LA(4);

            	                if ( (LA18_4 == ID) )
            	                {
            	                    alt18 = 1;
            	                }


            	            }


            	        }


            	    }


            	    switch (alt18) 
            		{
            			case 1 :
            			    // LPMEDParser.g:124:11: DOT nodes+= ID
            			    {
            			    	DOT101=(IToken)Match(input,DOT,FOLLOW_DOT_in_qualifiedName856); if (state.failed) return retval; 
            			    	if ( state.backtracking==0 ) stream_DOT.Add(DOT101);

            			    	nodes=(IToken)Match(input,ID,FOLLOW_ID_in_qualifiedName860); if (state.failed) return retval; 
            			    	if ( state.backtracking==0 ) stream_ID.Add(nodes);

            			    	if (list_nodes == null) list_nodes = new ArrayList();
            			    	list_nodes.Add(nodes);


            			    }
            			    break;

            			default:
            			    if ( cnt18 >= 1 ) goto loop18;
            			    if ( state.backtracking > 0 ) {state.failed = true; return retval;}
            		            EarlyExitException eee =
            		                new EarlyExitException(18, input);
            		            throw eee;
            	    }
            	    cnt18++;
            	} while (true);

            	loop18:
            		;	// Stops C# compiler whinging that label 'loop18' has no statements

            	DOT102=(IToken)Match(input,DOT,FOLLOW_DOT_in_qualifiedName865); if (state.failed) return retval; 
            	if ( state.backtracking==0 ) stream_DOT.Add(DOT102);

            	sm=(IToken)Match(input,ID,FOLLOW_ID_in_qualifiedName869); if (state.failed) return retval; 
            	if ( state.backtracking==0 ) stream_ID.Add(sm);



            	// AST REWRITE
            	// elements:          nodes, sm, name
            	// token labels:      sm, name
            	// rule labels:       retval
            	// token list labels: nodes
            	// rule list labels:  
            	if ( state.backtracking==0 ) {
            	retval.Tree = root_0;
            	RewriteRuleTokenStream stream_sm = new RewriteRuleTokenStream(adaptor, "token sm", sm);
            	RewriteRuleTokenStream stream_name = new RewriteRuleTokenStream(adaptor, "token name", name);
            	RewriteRuleTokenStream stream_nodes = new RewriteRuleTokenStream(adaptor,"token nodes", list_nodes);
            	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

            	root_0 = (CommonTree)adaptor.GetNilNode();
            	// 124:38: -> ^( OBJECTNAME $name) ^( NODES ( $nodes)* ) ^( MEMBERNAME $sm)
            	{
            	    // LPMEDParser.g:124:41: ^( OBJECTNAME $name)
            	    {
            	    CommonTree root_1 = (CommonTree)adaptor.GetNilNode();
            	    root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(OBJECTNAME, "OBJECTNAME"), root_1);

            	    adaptor.AddChild(root_1, stream_name.NextNode());

            	    adaptor.AddChild(root_0, root_1);
            	    }
            	    // LPMEDParser.g:124:61: ^( NODES ( $nodes)* )
            	    {
            	    CommonTree root_1 = (CommonTree)adaptor.GetNilNode();
            	    root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(NODES, "NODES"), root_1);

            	    // LPMEDParser.g:124:69: ( $nodes)*
            	    while ( stream_nodes.HasNext() )
            	    {
            	        adaptor.AddChild(root_1, stream_nodes.NextNode());

            	    }
            	    stream_nodes.Reset();

            	    adaptor.AddChild(root_0, root_1);
            	    }
            	    // LPMEDParser.g:124:78: ^( MEMBERNAME $sm)
            	    {
            	    CommonTree root_1 = (CommonTree)adaptor.GetNilNode();
            	    root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(MEMBERNAME, "MEMBERNAME"), root_1);

            	    adaptor.AddChild(root_1, stream_sm.NextNode());

            	    adaptor.AddChild(root_0, root_1);
            	    }

            	}

            	retval.Tree = root_0;retval.Tree = root_0;}
            }

            retval.Stop = input.LT(-1);

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);}
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
    	// Conversion of the second argument necessary, but harmless
    	retval.Tree = (CommonTree)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "qualifiedName"

    public class deviceMemberID_return : ParserRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "deviceMemberID"
    // LPMEDParser.g:127:1: deviceMemberID : ( qualifiedName DOT GO -> ^( CASYNCCALL qualifiedName ) | qualifiedName DOT WAIT -> ^( CWAITTHECALL qualifiedName ) | qualifiedName DOT ENDPRESSURE -> ^( CENDTHECALL qualifiedName ) | qualifiedName -> ^( CSYNCCALL qualifiedName ) | name= ID DOT sm= ID DOT GO -> ^( CASYNCCALL ^( OBJECTNAME $name) ^( NODES ID ) ^( MEMBERNAME $sm) ) | name= ID DOT sm= ID DOT WAIT -> ^( CWAITTHECALL ^( OBJECTNAME $name) ^( NODES ID ) ^( MEMBERNAME $sm) ) | name= ID DOT sm= ID -> ^( CSYNCCALL ^( OBJECTNAME $name) ^( NODES ID ) ^( MEMBERNAME $sm) ) );
    public LPMEDParser.deviceMemberID_return deviceMemberID() // throws RecognitionException [1]
    {   
        LPMEDParser.deviceMemberID_return retval = new LPMEDParser.deviceMemberID_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        IToken name = null;
        IToken sm = null;
        IToken DOT104 = null;
        IToken GO105 = null;
        IToken DOT107 = null;
        IToken WAIT108 = null;
        IToken DOT110 = null;
        IToken ENDPRESSURE111 = null;
        IToken DOT113 = null;
        IToken DOT114 = null;
        IToken GO115 = null;
        IToken DOT116 = null;
        IToken DOT117 = null;
        IToken WAIT118 = null;
        IToken DOT119 = null;
        LPMEDParser.qualifiedName_return qualifiedName103 = default(LPMEDParser.qualifiedName_return);

        LPMEDParser.qualifiedName_return qualifiedName106 = default(LPMEDParser.qualifiedName_return);

        LPMEDParser.qualifiedName_return qualifiedName109 = default(LPMEDParser.qualifiedName_return);

        LPMEDParser.qualifiedName_return qualifiedName112 = default(LPMEDParser.qualifiedName_return);


        CommonTree name_tree=null;
        CommonTree sm_tree=null;
        CommonTree DOT104_tree=null;
        CommonTree GO105_tree=null;
        CommonTree DOT107_tree=null;
        CommonTree WAIT108_tree=null;
        CommonTree DOT110_tree=null;
        CommonTree ENDPRESSURE111_tree=null;
        CommonTree DOT113_tree=null;
        CommonTree DOT114_tree=null;
        CommonTree GO115_tree=null;
        CommonTree DOT116_tree=null;
        CommonTree DOT117_tree=null;
        CommonTree WAIT118_tree=null;
        CommonTree DOT119_tree=null;
        RewriteRuleTokenStream stream_WAIT = new RewriteRuleTokenStream(adaptor,"token WAIT");
        RewriteRuleTokenStream stream_GO = new RewriteRuleTokenStream(adaptor,"token GO");
        RewriteRuleTokenStream stream_ID = new RewriteRuleTokenStream(adaptor,"token ID");
        RewriteRuleTokenStream stream_DOT = new RewriteRuleTokenStream(adaptor,"token DOT");
        RewriteRuleTokenStream stream_ENDPRESSURE = new RewriteRuleTokenStream(adaptor,"token ENDPRESSURE");
        RewriteRuleSubtreeStream stream_qualifiedName = new RewriteRuleSubtreeStream(adaptor,"rule qualifiedName");
        try 
    	{
            // LPMEDParser.g:127:17: ( qualifiedName DOT GO -> ^( CASYNCCALL qualifiedName ) | qualifiedName DOT WAIT -> ^( CWAITTHECALL qualifiedName ) | qualifiedName DOT ENDPRESSURE -> ^( CENDTHECALL qualifiedName ) | qualifiedName -> ^( CSYNCCALL qualifiedName ) | name= ID DOT sm= ID DOT GO -> ^( CASYNCCALL ^( OBJECTNAME $name) ^( NODES ID ) ^( MEMBERNAME $sm) ) | name= ID DOT sm= ID DOT WAIT -> ^( CWAITTHECALL ^( OBJECTNAME $name) ^( NODES ID ) ^( MEMBERNAME $sm) ) | name= ID DOT sm= ID -> ^( CSYNCCALL ^( OBJECTNAME $name) ^( NODES ID ) ^( MEMBERNAME $sm) ) )
            int alt19 = 7;
            alt19 = dfa19.Predict(input);
            switch (alt19) 
            {
                case 1 :
                    // LPMEDParser.g:128:4: qualifiedName DOT GO
                    {
                    	PushFollow(FOLLOW_qualifiedName_in_deviceMemberID908);
                    	qualifiedName103 = qualifiedName();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) stream_qualifiedName.Add(qualifiedName103.Tree);
                    	DOT104=(IToken)Match(input,DOT,FOLLOW_DOT_in_deviceMemberID910); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_DOT.Add(DOT104);

                    	GO105=(IToken)Match(input,GO,FOLLOW_GO_in_deviceMemberID912); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_GO.Add(GO105);



                    	// AST REWRITE
                    	// elements:          qualifiedName
                    	// token labels:      
                    	// rule labels:       retval
                    	// token list labels: 
                    	// rule list labels:  
                    	if ( state.backtracking==0 ) {
                    	retval.Tree = root_0;
                    	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

                    	root_0 = (CommonTree)adaptor.GetNilNode();
                    	// 129:5: -> ^( CASYNCCALL qualifiedName )
                    	{
                    	    // LPMEDParser.g:129:8: ^( CASYNCCALL qualifiedName )
                    	    {
                    	    CommonTree root_1 = (CommonTree)adaptor.GetNilNode();
                    	    root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(CASYNCCALL, "CASYNCCALL"), root_1);

                    	    adaptor.AddChild(root_1, stream_qualifiedName.NextTree());

                    	    adaptor.AddChild(root_0, root_1);
                    	    }

                    	}

                    	retval.Tree = root_0;retval.Tree = root_0;}
                    }
                    break;
                case 2 :
                    // LPMEDParser.g:130:6: qualifiedName DOT WAIT
                    {
                    	PushFollow(FOLLOW_qualifiedName_in_deviceMemberID932);
                    	qualifiedName106 = qualifiedName();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) stream_qualifiedName.Add(qualifiedName106.Tree);
                    	DOT107=(IToken)Match(input,DOT,FOLLOW_DOT_in_deviceMemberID934); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_DOT.Add(DOT107);

                    	WAIT108=(IToken)Match(input,WAIT,FOLLOW_WAIT_in_deviceMemberID936); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_WAIT.Add(WAIT108);



                    	// AST REWRITE
                    	// elements:          qualifiedName
                    	// token labels:      
                    	// rule labels:       retval
                    	// token list labels: 
                    	// rule list labels:  
                    	if ( state.backtracking==0 ) {
                    	retval.Tree = root_0;
                    	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

                    	root_0 = (CommonTree)adaptor.GetNilNode();
                    	// 131:5: -> ^( CWAITTHECALL qualifiedName )
                    	{
                    	    // LPMEDParser.g:131:8: ^( CWAITTHECALL qualifiedName )
                    	    {
                    	    CommonTree root_1 = (CommonTree)adaptor.GetNilNode();
                    	    root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(CWAITTHECALL, "CWAITTHECALL"), root_1);

                    	    adaptor.AddChild(root_1, stream_qualifiedName.NextTree());

                    	    adaptor.AddChild(root_0, root_1);
                    	    }

                    	}

                    	retval.Tree = root_0;retval.Tree = root_0;}
                    }
                    break;
                case 3 :
                    // LPMEDParser.g:132:5: qualifiedName DOT ENDPRESSURE
                    {
                    	PushFollow(FOLLOW_qualifiedName_in_deviceMemberID954);
                    	qualifiedName109 = qualifiedName();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) stream_qualifiedName.Add(qualifiedName109.Tree);
                    	DOT110=(IToken)Match(input,DOT,FOLLOW_DOT_in_deviceMemberID956); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_DOT.Add(DOT110);

                    	ENDPRESSURE111=(IToken)Match(input,ENDPRESSURE,FOLLOW_ENDPRESSURE_in_deviceMemberID958); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_ENDPRESSURE.Add(ENDPRESSURE111);



                    	// AST REWRITE
                    	// elements:          qualifiedName
                    	// token labels:      
                    	// rule labels:       retval
                    	// token list labels: 
                    	// rule list labels:  
                    	if ( state.backtracking==0 ) {
                    	retval.Tree = root_0;
                    	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

                    	root_0 = (CommonTree)adaptor.GetNilNode();
                    	// 133:5: -> ^( CENDTHECALL qualifiedName )
                    	{
                    	    // LPMEDParser.g:133:8: ^( CENDTHECALL qualifiedName )
                    	    {
                    	    CommonTree root_1 = (CommonTree)adaptor.GetNilNode();
                    	    root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(CENDTHECALL, "CENDTHECALL"), root_1);

                    	    adaptor.AddChild(root_1, stream_qualifiedName.NextTree());

                    	    adaptor.AddChild(root_0, root_1);
                    	    }

                    	}

                    	retval.Tree = root_0;retval.Tree = root_0;}
                    }
                    break;
                case 4 :
                    // LPMEDParser.g:134:6: qualifiedName
                    {
                    	PushFollow(FOLLOW_qualifiedName_in_deviceMemberID977);
                    	qualifiedName112 = qualifiedName();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) stream_qualifiedName.Add(qualifiedName112.Tree);


                    	// AST REWRITE
                    	// elements:          qualifiedName
                    	// token labels:      
                    	// rule labels:       retval
                    	// token list labels: 
                    	// rule list labels:  
                    	if ( state.backtracking==0 ) {
                    	retval.Tree = root_0;
                    	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

                    	root_0 = (CommonTree)adaptor.GetNilNode();
                    	// 135:5: -> ^( CSYNCCALL qualifiedName )
                    	{
                    	    // LPMEDParser.g:135:8: ^( CSYNCCALL qualifiedName )
                    	    {
                    	    CommonTree root_1 = (CommonTree)adaptor.GetNilNode();
                    	    root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(CSYNCCALL, "CSYNCCALL"), root_1);

                    	    adaptor.AddChild(root_1, stream_qualifiedName.NextTree());

                    	    adaptor.AddChild(root_0, root_1);
                    	    }

                    	}

                    	retval.Tree = root_0;retval.Tree = root_0;}
                    }
                    break;
                case 5 :
                    // LPMEDParser.g:136:5: name= ID DOT sm= ID DOT GO
                    {
                    	name=(IToken)Match(input,ID,FOLLOW_ID_in_deviceMemberID997); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_ID.Add(name);

                    	DOT113=(IToken)Match(input,DOT,FOLLOW_DOT_in_deviceMemberID999); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_DOT.Add(DOT113);

                    	sm=(IToken)Match(input,ID,FOLLOW_ID_in_deviceMemberID1003); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_ID.Add(sm);

                    	DOT114=(IToken)Match(input,DOT,FOLLOW_DOT_in_deviceMemberID1005); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_DOT.Add(DOT114);

                    	GO115=(IToken)Match(input,GO,FOLLOW_GO_in_deviceMemberID1007); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_GO.Add(GO115);



                    	// AST REWRITE
                    	// elements:          name, ID, sm
                    	// token labels:      sm, name
                    	// rule labels:       retval
                    	// token list labels: 
                    	// rule list labels:  
                    	if ( state.backtracking==0 ) {
                    	retval.Tree = root_0;
                    	RewriteRuleTokenStream stream_sm = new RewriteRuleTokenStream(adaptor, "token sm", sm);
                    	RewriteRuleTokenStream stream_name = new RewriteRuleTokenStream(adaptor, "token name", name);
                    	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

                    	root_0 = (CommonTree)adaptor.GetNilNode();
                    	// 137:5: -> ^( CASYNCCALL ^( OBJECTNAME $name) ^( NODES ID ) ^( MEMBERNAME $sm) )
                    	{
                    	    // LPMEDParser.g:137:8: ^( CASYNCCALL ^( OBJECTNAME $name) ^( NODES ID ) ^( MEMBERNAME $sm) )
                    	    {
                    	    CommonTree root_1 = (CommonTree)adaptor.GetNilNode();
                    	    root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(CASYNCCALL, "CASYNCCALL"), root_1);

                    	    // LPMEDParser.g:137:21: ^( OBJECTNAME $name)
                    	    {
                    	    CommonTree root_2 = (CommonTree)adaptor.GetNilNode();
                    	    root_2 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(OBJECTNAME, "OBJECTNAME"), root_2);

                    	    adaptor.AddChild(root_2, stream_name.NextNode());

                    	    adaptor.AddChild(root_1, root_2);
                    	    }
                    	    // LPMEDParser.g:137:41: ^( NODES ID )
                    	    {
                    	    CommonTree root_2 = (CommonTree)adaptor.GetNilNode();
                    	    root_2 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(NODES, "NODES"), root_2);

                    	    adaptor.AddChild(root_2, stream_ID.NextNode());

                    	    adaptor.AddChild(root_1, root_2);
                    	    }
                    	    // LPMEDParser.g:137:53: ^( MEMBERNAME $sm)
                    	    {
                    	    CommonTree root_2 = (CommonTree)adaptor.GetNilNode();
                    	    root_2 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(MEMBERNAME, "MEMBERNAME"), root_2);

                    	    adaptor.AddChild(root_2, stream_sm.NextNode());

                    	    adaptor.AddChild(root_1, root_2);
                    	    }

                    	    adaptor.AddChild(root_0, root_1);
                    	    }

                    	}

                    	retval.Tree = root_0;retval.Tree = root_0;}
                    }
                    break;
                case 6 :
                    // LPMEDParser.g:138:5: name= ID DOT sm= ID DOT WAIT
                    {
                    	name=(IToken)Match(input,ID,FOLLOW_ID_in_deviceMemberID1047); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_ID.Add(name);

                    	DOT116=(IToken)Match(input,DOT,FOLLOW_DOT_in_deviceMemberID1049); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_DOT.Add(DOT116);

                    	sm=(IToken)Match(input,ID,FOLLOW_ID_in_deviceMemberID1053); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_ID.Add(sm);

                    	DOT117=(IToken)Match(input,DOT,FOLLOW_DOT_in_deviceMemberID1055); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_DOT.Add(DOT117);

                    	WAIT118=(IToken)Match(input,WAIT,FOLLOW_WAIT_in_deviceMemberID1057); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_WAIT.Add(WAIT118);



                    	// AST REWRITE
                    	// elements:          name, sm, ID
                    	// token labels:      sm, name
                    	// rule labels:       retval
                    	// token list labels: 
                    	// rule list labels:  
                    	if ( state.backtracking==0 ) {
                    	retval.Tree = root_0;
                    	RewriteRuleTokenStream stream_sm = new RewriteRuleTokenStream(adaptor, "token sm", sm);
                    	RewriteRuleTokenStream stream_name = new RewriteRuleTokenStream(adaptor, "token name", name);
                    	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

                    	root_0 = (CommonTree)adaptor.GetNilNode();
                    	// 139:5: -> ^( CWAITTHECALL ^( OBJECTNAME $name) ^( NODES ID ) ^( MEMBERNAME $sm) )
                    	{
                    	    // LPMEDParser.g:139:8: ^( CWAITTHECALL ^( OBJECTNAME $name) ^( NODES ID ) ^( MEMBERNAME $sm) )
                    	    {
                    	    CommonTree root_1 = (CommonTree)adaptor.GetNilNode();
                    	    root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(CWAITTHECALL, "CWAITTHECALL"), root_1);

                    	    // LPMEDParser.g:139:23: ^( OBJECTNAME $name)
                    	    {
                    	    CommonTree root_2 = (CommonTree)adaptor.GetNilNode();
                    	    root_2 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(OBJECTNAME, "OBJECTNAME"), root_2);

                    	    adaptor.AddChild(root_2, stream_name.NextNode());

                    	    adaptor.AddChild(root_1, root_2);
                    	    }
                    	    // LPMEDParser.g:139:43: ^( NODES ID )
                    	    {
                    	    CommonTree root_2 = (CommonTree)adaptor.GetNilNode();
                    	    root_2 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(NODES, "NODES"), root_2);

                    	    adaptor.AddChild(root_2, stream_ID.NextNode());

                    	    adaptor.AddChild(root_1, root_2);
                    	    }
                    	    // LPMEDParser.g:139:55: ^( MEMBERNAME $sm)
                    	    {
                    	    CommonTree root_2 = (CommonTree)adaptor.GetNilNode();
                    	    root_2 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(MEMBERNAME, "MEMBERNAME"), root_2);

                    	    adaptor.AddChild(root_2, stream_sm.NextNode());

                    	    adaptor.AddChild(root_1, root_2);
                    	    }

                    	    adaptor.AddChild(root_0, root_1);
                    	    }

                    	}

                    	retval.Tree = root_0;retval.Tree = root_0;}
                    }
                    break;
                case 7 :
                    // LPMEDParser.g:140:5: name= ID DOT sm= ID
                    {
                    	name=(IToken)Match(input,ID,FOLLOW_ID_in_deviceMemberID1096); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_ID.Add(name);

                    	DOT119=(IToken)Match(input,DOT,FOLLOW_DOT_in_deviceMemberID1098); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_DOT.Add(DOT119);

                    	sm=(IToken)Match(input,ID,FOLLOW_ID_in_deviceMemberID1102); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_ID.Add(sm);



                    	// AST REWRITE
                    	// elements:          name, ID, sm
                    	// token labels:      sm, name
                    	// rule labels:       retval
                    	// token list labels: 
                    	// rule list labels:  
                    	if ( state.backtracking==0 ) {
                    	retval.Tree = root_0;
                    	RewriteRuleTokenStream stream_sm = new RewriteRuleTokenStream(adaptor, "token sm", sm);
                    	RewriteRuleTokenStream stream_name = new RewriteRuleTokenStream(adaptor, "token name", name);
                    	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

                    	root_0 = (CommonTree)adaptor.GetNilNode();
                    	// 141:5: -> ^( CSYNCCALL ^( OBJECTNAME $name) ^( NODES ID ) ^( MEMBERNAME $sm) )
                    	{
                    	    // LPMEDParser.g:141:8: ^( CSYNCCALL ^( OBJECTNAME $name) ^( NODES ID ) ^( MEMBERNAME $sm) )
                    	    {
                    	    CommonTree root_1 = (CommonTree)adaptor.GetNilNode();
                    	    root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(CSYNCCALL, "CSYNCCALL"), root_1);

                    	    // LPMEDParser.g:141:20: ^( OBJECTNAME $name)
                    	    {
                    	    CommonTree root_2 = (CommonTree)adaptor.GetNilNode();
                    	    root_2 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(OBJECTNAME, "OBJECTNAME"), root_2);

                    	    adaptor.AddChild(root_2, stream_name.NextNode());

                    	    adaptor.AddChild(root_1, root_2);
                    	    }
                    	    // LPMEDParser.g:141:40: ^( NODES ID )
                    	    {
                    	    CommonTree root_2 = (CommonTree)adaptor.GetNilNode();
                    	    root_2 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(NODES, "NODES"), root_2);

                    	    adaptor.AddChild(root_2, stream_ID.NextNode());

                    	    adaptor.AddChild(root_1, root_2);
                    	    }
                    	    // LPMEDParser.g:141:52: ^( MEMBERNAME $sm)
                    	    {
                    	    CommonTree root_2 = (CommonTree)adaptor.GetNilNode();
                    	    root_2 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(MEMBERNAME, "MEMBERNAME"), root_2);

                    	    adaptor.AddChild(root_2, stream_sm.NextNode());

                    	    adaptor.AddChild(root_1, root_2);
                    	    }

                    	    adaptor.AddChild(root_0, root_1);
                    	    }

                    	}

                    	retval.Tree = root_0;retval.Tree = root_0;}
                    }
                    break;

            }
            retval.Stop = input.LT(-1);

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);}
        }
        catch (Exception e) 
        {
            Logger.Add(e); if (e is RecognitionException) Recover(input,(RecognitionException)e);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "deviceMemberID"

    public class deviceMethodCall_return : ParserRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "deviceMethodCall"
    // LPMEDParser.g:146:1: deviceMethodCall : deviceMemberID OBRACKET CBRACKET -> ^( CCALL deviceMemberID ) ;
    public LPMEDParser.deviceMethodCall_return deviceMethodCall() // throws RecognitionException [1]
    {   
        LPMEDParser.deviceMethodCall_return retval = new LPMEDParser.deviceMethodCall_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        IToken OBRACKET121 = null;
        IToken CBRACKET122 = null;
        LPMEDParser.deviceMemberID_return deviceMemberID120 = default(LPMEDParser.deviceMemberID_return);


        CommonTree OBRACKET121_tree=null;
        CommonTree CBRACKET122_tree=null;
        RewriteRuleTokenStream stream_OBRACKET = new RewriteRuleTokenStream(adaptor,"token OBRACKET");
        RewriteRuleTokenStream stream_CBRACKET = new RewriteRuleTokenStream(adaptor,"token CBRACKET");
        RewriteRuleSubtreeStream stream_deviceMemberID = new RewriteRuleSubtreeStream(adaptor,"rule deviceMemberID");
        try 
    	{
            // LPMEDParser.g:146:19: ( deviceMemberID OBRACKET CBRACKET -> ^( CCALL deviceMemberID ) )
            // LPMEDParser.g:146:21: deviceMemberID OBRACKET CBRACKET
            {
            	PushFollow(FOLLOW_deviceMemberID_in_deviceMethodCall1150);
            	deviceMemberID120 = deviceMemberID();
            	state.followingStackPointer--;
            	if (state.failed) return retval;
            	if ( state.backtracking==0 ) stream_deviceMemberID.Add(deviceMemberID120.Tree);
            	OBRACKET121=(IToken)Match(input,OBRACKET,FOLLOW_OBRACKET_in_deviceMethodCall1152); if (state.failed) return retval; 
            	if ( state.backtracking==0 ) stream_OBRACKET.Add(OBRACKET121);

            	CBRACKET122=(IToken)Match(input,CBRACKET,FOLLOW_CBRACKET_in_deviceMethodCall1154); if (state.failed) return retval; 
            	if ( state.backtracking==0 ) stream_CBRACKET.Add(CBRACKET122);



            	// AST REWRITE
            	// elements:          deviceMemberID
            	// token labels:      
            	// rule labels:       retval
            	// token list labels: 
            	// rule list labels:  
            	if ( state.backtracking==0 ) {
            	retval.Tree = root_0;
            	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

            	root_0 = (CommonTree)adaptor.GetNilNode();
            	// 146:54: -> ^( CCALL deviceMemberID )
            	{
            	    // LPMEDParser.g:146:57: ^( CCALL deviceMemberID )
            	    {
            	    CommonTree root_1 = (CommonTree)adaptor.GetNilNode();
            	    root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(CCALL, "CCALL"), root_1);

            	    adaptor.AddChild(root_1, stream_deviceMemberID.NextTree());

            	    adaptor.AddChild(root_0, root_1);
            	    }

            	}

            	retval.Tree = root_0;retval.Tree = root_0;}
            }

            retval.Stop = input.LT(-1);

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);}
        }
        catch (Exception e) 
        {
            Logger.Add(e); if (e is RecognitionException) Recover(input,(RecognitionException)e);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "deviceMethodCall"

    public class functionCall_return : ParserRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "functionCall"
    // LPMEDParser.g:149:1: functionCall : ( functionSignature DOT GO OBRACKET CBRACKET -> ^( CASYNCFUNCCALL functionSignature ) | functionSignature DOT WAIT OBRACKET CBRACKET -> ^( CWAITFUNCFINISH functionSignature ) | functionSignature OBRACKET CBRACKET -> ^( CSYNCFUNCCALL functionSignature ) );
    public LPMEDParser.functionCall_return functionCall() // throws RecognitionException [1]
    {   
        LPMEDParser.functionCall_return retval = new LPMEDParser.functionCall_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        IToken DOT124 = null;
        IToken GO125 = null;
        IToken OBRACKET126 = null;
        IToken CBRACKET127 = null;
        IToken DOT129 = null;
        IToken WAIT130 = null;
        IToken OBRACKET131 = null;
        IToken CBRACKET132 = null;
        IToken OBRACKET134 = null;
        IToken CBRACKET135 = null;
        LPMEDParser.functionSignature_return functionSignature123 = default(LPMEDParser.functionSignature_return);

        LPMEDParser.functionSignature_return functionSignature128 = default(LPMEDParser.functionSignature_return);

        LPMEDParser.functionSignature_return functionSignature133 = default(LPMEDParser.functionSignature_return);


        CommonTree DOT124_tree=null;
        CommonTree GO125_tree=null;
        CommonTree OBRACKET126_tree=null;
        CommonTree CBRACKET127_tree=null;
        CommonTree DOT129_tree=null;
        CommonTree WAIT130_tree=null;
        CommonTree OBRACKET131_tree=null;
        CommonTree CBRACKET132_tree=null;
        CommonTree OBRACKET134_tree=null;
        CommonTree CBRACKET135_tree=null;
        RewriteRuleTokenStream stream_WAIT = new RewriteRuleTokenStream(adaptor,"token WAIT");
        RewriteRuleTokenStream stream_GO = new RewriteRuleTokenStream(adaptor,"token GO");
        RewriteRuleTokenStream stream_OBRACKET = new RewriteRuleTokenStream(adaptor,"token OBRACKET");
        RewriteRuleTokenStream stream_DOT = new RewriteRuleTokenStream(adaptor,"token DOT");
        RewriteRuleTokenStream stream_CBRACKET = new RewriteRuleTokenStream(adaptor,"token CBRACKET");
        RewriteRuleSubtreeStream stream_functionSignature = new RewriteRuleSubtreeStream(adaptor,"rule functionSignature");
        try 
    	{
            // LPMEDParser.g:149:15: ( functionSignature DOT GO OBRACKET CBRACKET -> ^( CASYNCFUNCCALL functionSignature ) | functionSignature DOT WAIT OBRACKET CBRACKET -> ^( CWAITFUNCFINISH functionSignature ) | functionSignature OBRACKET CBRACKET -> ^( CSYNCFUNCCALL functionSignature ) )
            int alt20 = 3;
            alt20 = dfa20.Predict(input);
            switch (alt20) 
            {
                case 1 :
                    // LPMEDParser.g:150:4: functionSignature DOT GO OBRACKET CBRACKET
                    {
                    	PushFollow(FOLLOW_functionSignature_in_functionCall1181);
                    	functionSignature123 = functionSignature();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) stream_functionSignature.Add(functionSignature123.Tree);
                    	DOT124=(IToken)Match(input,DOT,FOLLOW_DOT_in_functionCall1183); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_DOT.Add(DOT124);

                    	GO125=(IToken)Match(input,GO,FOLLOW_GO_in_functionCall1185); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_GO.Add(GO125);

                    	OBRACKET126=(IToken)Match(input,OBRACKET,FOLLOW_OBRACKET_in_functionCall1187); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_OBRACKET.Add(OBRACKET126);

                    	CBRACKET127=(IToken)Match(input,CBRACKET,FOLLOW_CBRACKET_in_functionCall1189); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_CBRACKET.Add(CBRACKET127);



                    	// AST REWRITE
                    	// elements:          functionSignature
                    	// token labels:      
                    	// rule labels:       retval
                    	// token list labels: 
                    	// rule list labels:  
                    	if ( state.backtracking==0 ) {
                    	retval.Tree = root_0;
                    	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

                    	root_0 = (CommonTree)adaptor.GetNilNode();
                    	// 151:5: -> ^( CASYNCFUNCCALL functionSignature )
                    	{
                    	    // LPMEDParser.g:151:8: ^( CASYNCFUNCCALL functionSignature )
                    	    {
                    	    CommonTree root_1 = (CommonTree)adaptor.GetNilNode();
                    	    root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(CASYNCFUNCCALL, "CASYNCFUNCCALL"), root_1);

                    	    adaptor.AddChild(root_1, stream_functionSignature.NextTree());

                    	    adaptor.AddChild(root_0, root_1);
                    	    }

                    	}

                    	retval.Tree = root_0;retval.Tree = root_0;}
                    }
                    break;
                case 2 :
                    // LPMEDParser.g:152:6: functionSignature DOT WAIT OBRACKET CBRACKET
                    {
                    	PushFollow(FOLLOW_functionSignature_in_functionCall1208);
                    	functionSignature128 = functionSignature();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) stream_functionSignature.Add(functionSignature128.Tree);
                    	DOT129=(IToken)Match(input,DOT,FOLLOW_DOT_in_functionCall1210); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_DOT.Add(DOT129);

                    	WAIT130=(IToken)Match(input,WAIT,FOLLOW_WAIT_in_functionCall1212); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_WAIT.Add(WAIT130);

                    	OBRACKET131=(IToken)Match(input,OBRACKET,FOLLOW_OBRACKET_in_functionCall1214); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_OBRACKET.Add(OBRACKET131);

                    	CBRACKET132=(IToken)Match(input,CBRACKET,FOLLOW_CBRACKET_in_functionCall1216); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_CBRACKET.Add(CBRACKET132);



                    	// AST REWRITE
                    	// elements:          functionSignature
                    	// token labels:      
                    	// rule labels:       retval
                    	// token list labels: 
                    	// rule list labels:  
                    	if ( state.backtracking==0 ) {
                    	retval.Tree = root_0;
                    	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

                    	root_0 = (CommonTree)adaptor.GetNilNode();
                    	// 153:5: -> ^( CWAITFUNCFINISH functionSignature )
                    	{
                    	    // LPMEDParser.g:153:8: ^( CWAITFUNCFINISH functionSignature )
                    	    {
                    	    CommonTree root_1 = (CommonTree)adaptor.GetNilNode();
                    	    root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(CWAITFUNCFINISH, "CWAITFUNCFINISH"), root_1);

                    	    adaptor.AddChild(root_1, stream_functionSignature.NextTree());

                    	    adaptor.AddChild(root_0, root_1);
                    	    }

                    	}

                    	retval.Tree = root_0;retval.Tree = root_0;}
                    }
                    break;
                case 3 :
                    // LPMEDParser.g:154:5: functionSignature OBRACKET CBRACKET
                    {
                    	PushFollow(FOLLOW_functionSignature_in_functionCall1234);
                    	functionSignature133 = functionSignature();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) stream_functionSignature.Add(functionSignature133.Tree);
                    	OBRACKET134=(IToken)Match(input,OBRACKET,FOLLOW_OBRACKET_in_functionCall1236); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_OBRACKET.Add(OBRACKET134);

                    	CBRACKET135=(IToken)Match(input,CBRACKET,FOLLOW_CBRACKET_in_functionCall1238); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_CBRACKET.Add(CBRACKET135);



                    	// AST REWRITE
                    	// elements:          functionSignature
                    	// token labels:      
                    	// rule labels:       retval
                    	// token list labels: 
                    	// rule list labels:  
                    	if ( state.backtracking==0 ) {
                    	retval.Tree = root_0;
                    	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

                    	root_0 = (CommonTree)adaptor.GetNilNode();
                    	// 155:5: -> ^( CSYNCFUNCCALL functionSignature )
                    	{
                    	    // LPMEDParser.g:155:8: ^( CSYNCFUNCCALL functionSignature )
                    	    {
                    	    CommonTree root_1 = (CommonTree)adaptor.GetNilNode();
                    	    root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(CSYNCFUNCCALL, "CSYNCFUNCCALL"), root_1);

                    	    adaptor.AddChild(root_1, stream_functionSignature.NextTree());

                    	    adaptor.AddChild(root_0, root_1);
                    	    }

                    	}

                    	retval.Tree = root_0;retval.Tree = root_0;}
                    }
                    break;

            }
            retval.Stop = input.LT(-1);

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);}
        }
        catch (Exception e) 
        {
            Logger.Add(e); if (e is RecognitionException) Recover(input,(RecognitionException)e);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "functionCall"

    public class functionSignature_return : ParserRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "functionSignature"
    // LPMEDParser.g:159:1: functionSignature : ID OBRACKET ( parameterList )? CBRACKET -> ID ( parameterList )? ;
    public LPMEDParser.functionSignature_return functionSignature() // throws RecognitionException [1]
    {   
        LPMEDParser.functionSignature_return retval = new LPMEDParser.functionSignature_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        IToken ID136 = null;
        IToken OBRACKET137 = null;
        IToken CBRACKET139 = null;
        LPMEDParser.parameterList_return parameterList138 = default(LPMEDParser.parameterList_return);


        CommonTree ID136_tree=null;
        CommonTree OBRACKET137_tree=null;
        CommonTree CBRACKET139_tree=null;
        RewriteRuleTokenStream stream_OBRACKET = new RewriteRuleTokenStream(adaptor,"token OBRACKET");
        RewriteRuleTokenStream stream_ID = new RewriteRuleTokenStream(adaptor,"token ID");
        RewriteRuleTokenStream stream_CBRACKET = new RewriteRuleTokenStream(adaptor,"token CBRACKET");
        RewriteRuleSubtreeStream stream_parameterList = new RewriteRuleSubtreeStream(adaptor,"rule parameterList");
        try 
    	{
            // LPMEDParser.g:159:19: ( ID OBRACKET ( parameterList )? CBRACKET -> ID ( parameterList )? )
            // LPMEDParser.g:161:2: ID OBRACKET ( parameterList )? CBRACKET
            {
            	ID136=(IToken)Match(input,ID,FOLLOW_ID_in_functionSignature1268); if (state.failed) return retval; 
            	if ( state.backtracking==0 ) stream_ID.Add(ID136);

            	OBRACKET137=(IToken)Match(input,OBRACKET,FOLLOW_OBRACKET_in_functionSignature1270); if (state.failed) return retval; 
            	if ( state.backtracking==0 ) stream_OBRACKET.Add(OBRACKET137);

            	// LPMEDParser.g:161:14: ( parameterList )?
            	int alt21 = 2;
            	int LA21_0 = input.LA(1);

            	if ( (LA21_0 == INT || LA21_0 == ID) )
            	{
            	    alt21 = 1;
            	}
            	switch (alt21) 
            	{
            	    case 1 :
            	        // LPMEDParser.g:161:14: parameterList
            	        {
            	        	PushFollow(FOLLOW_parameterList_in_functionSignature1272);
            	        	parameterList138 = parameterList();
            	        	state.followingStackPointer--;
            	        	if (state.failed) return retval;
            	        	if ( state.backtracking==0 ) stream_parameterList.Add(parameterList138.Tree);

            	        }
            	        break;

            	}

            	CBRACKET139=(IToken)Match(input,CBRACKET,FOLLOW_CBRACKET_in_functionSignature1275); if (state.failed) return retval; 
            	if ( state.backtracking==0 ) stream_CBRACKET.Add(CBRACKET139);



            	// AST REWRITE
            	// elements:          parameterList, ID
            	// token labels:      
            	// rule labels:       retval
            	// token list labels: 
            	// rule list labels:  
            	if ( state.backtracking==0 ) {
            	retval.Tree = root_0;
            	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

            	root_0 = (CommonTree)adaptor.GetNilNode();
            	// 161:38: -> ID ( parameterList )?
            	{
            	    adaptor.AddChild(root_0, stream_ID.NextNode());
            	    // LPMEDParser.g:161:44: ( parameterList )?
            	    if ( stream_parameterList.HasNext() )
            	    {
            	        adaptor.AddChild(root_0, stream_parameterList.NextTree());

            	    }
            	    stream_parameterList.Reset();

            	}

            	retval.Tree = root_0;retval.Tree = root_0;}
            }

            retval.Stop = input.LT(-1);

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);}
        }
        catch (Exception e) 
        {
            Logger.Add(e); if (e is RecognitionException) Recover(input,(RecognitionException)e);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "functionSignature"

    public class parameterList_return : ParserRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "parameterList"
    // LPMEDParser.g:165:1: parameterList : pars+= parameter ( COMMA pars+= parameter )* -> ( $pars)+ ;
    public LPMEDParser.parameterList_return parameterList() // throws RecognitionException [1]
    {   
        LPMEDParser.parameterList_return retval = new LPMEDParser.parameterList_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        IToken COMMA140 = null;
        IList list_pars = null;
        RuleReturnScope pars = null;
        CommonTree COMMA140_tree=null;
        RewriteRuleTokenStream stream_COMMA = new RewriteRuleTokenStream(adaptor,"token COMMA");
        RewriteRuleSubtreeStream stream_parameter = new RewriteRuleSubtreeStream(adaptor,"rule parameter");
        try 
    	{
            // LPMEDParser.g:165:15: (pars+= parameter ( COMMA pars+= parameter )* -> ( $pars)+ )
            // LPMEDParser.g:166:3: pars+= parameter ( COMMA pars+= parameter )*
            {
            	PushFollow(FOLLOW_parameter_in_parameterList1301);
            	pars = parameter();
            	state.followingStackPointer--;
            	if (state.failed) return retval;
            	if ( state.backtracking==0 ) stream_parameter.Add(pars.Tree);
            	if (list_pars == null) list_pars = new ArrayList();
            	list_pars.Add(pars.Tree);

            	// LPMEDParser.g:166:19: ( COMMA pars+= parameter )*
            	do 
            	{
            	    int alt22 = 2;
            	    int LA22_0 = input.LA(1);

            	    if ( (LA22_0 == COMMA) )
            	    {
            	        alt22 = 1;
            	    }


            	    switch (alt22) 
            		{
            			case 1 :
            			    // LPMEDParser.g:166:20: COMMA pars+= parameter
            			    {
            			    	COMMA140=(IToken)Match(input,COMMA,FOLLOW_COMMA_in_parameterList1304); if (state.failed) return retval; 
            			    	if ( state.backtracking==0 ) stream_COMMA.Add(COMMA140);

            			    	PushFollow(FOLLOW_parameter_in_parameterList1308);
            			    	pars = parameter();
            			    	state.followingStackPointer--;
            			    	if (state.failed) return retval;
            			    	if ( state.backtracking==0 ) stream_parameter.Add(pars.Tree);
            			    	if (list_pars == null) list_pars = new ArrayList();
            			    	list_pars.Add(pars.Tree);


            			    }
            			    break;

            			default:
            			    goto loop22;
            	    }
            	} while (true);

            	loop22:
            		;	// Stops C# compiler whining that label 'loop22' has no statements



            	// AST REWRITE
            	// elements:          pars
            	// token labels:      
            	// rule labels:       retval
            	// token list labels: 
            	// rule list labels:  pars
            	if ( state.backtracking==0 ) {
            	retval.Tree = root_0;
            	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));
            	RewriteRuleSubtreeStream stream_pars = new RewriteRuleSubtreeStream(adaptor, "token pars", list_pars);
            	root_0 = (CommonTree)adaptor.GetNilNode();
            	// 166:44: -> ( $pars)+
            	{
            	    if ( !(stream_pars.HasNext()) ) {
            	        throw new RewriteEarlyExitException();
            	    }
            	    while ( stream_pars.HasNext() )
            	    {
            	        adaptor.AddChild(root_0, stream_pars.NextTree());

            	    }
            	    stream_pars.Reset();

            	}

            	retval.Tree = root_0;retval.Tree = root_0;}
            }

            retval.Stop = input.LT(-1);

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);}
        }
        catch (Exception e) 
        {
            Logger.Add(e); if (e is RecognitionException) Recover(input,(RecognitionException)e);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "parameterList"

    public class parameter_return : ParserRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "parameter"
    // LPMEDParser.g:170:1: parameter : parameterValue -> ^( PARAM parameterValue ) ;
    public LPMEDParser.parameter_return parameter() // throws RecognitionException [1]
    {   
        LPMEDParser.parameter_return retval = new LPMEDParser.parameter_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        LPMEDParser.parameterValue_return parameterValue141 = default(LPMEDParser.parameterValue_return);


        RewriteRuleSubtreeStream stream_parameterValue = new RewriteRuleSubtreeStream(adaptor,"rule parameterValue");
        try 
    	{
            // LPMEDParser.g:170:11: ( parameterValue -> ^( PARAM parameterValue ) )
            // LPMEDParser.g:171:2: parameterValue
            {
            	PushFollow(FOLLOW_parameterValue_in_parameter1333);
            	parameterValue141 = parameterValue();
            	state.followingStackPointer--;
            	if (state.failed) return retval;
            	if ( state.backtracking==0 ) stream_parameterValue.Add(parameterValue141.Tree);


            	// AST REWRITE
            	// elements:          parameterValue
            	// token labels:      
            	// rule labels:       retval
            	// token list labels: 
            	// rule list labels:  
            	if ( state.backtracking==0 ) {
            	retval.Tree = root_0;
            	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

            	root_0 = (CommonTree)adaptor.GetNilNode();
            	// 171:17: -> ^( PARAM parameterValue )
            	{
            	    // LPMEDParser.g:171:20: ^( PARAM parameterValue )
            	    {
            	    CommonTree root_1 = (CommonTree)adaptor.GetNilNode();
            	    root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(PARAM, "PARAM"), root_1);

            	    adaptor.AddChild(root_1, stream_parameterValue.NextTree());

            	    adaptor.AddChild(root_0, root_1);
            	    }

            	}

            	retval.Tree = root_0;retval.Tree = root_0;}
            }

            retval.Stop = input.LT(-1);

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);}
        }
        catch (Exception e) 
        {
            Logger.Add(e); if (e is RecognitionException) Recover(input,(RecognitionException)e);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "parameter"

    public class parameterValue_return : ParserRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "parameterValue"
    // LPMEDParser.g:175:1: parameterValue : ( ID -> ID | INT -> INT | qualifiedName -> qualifiedName );
    public LPMEDParser.parameterValue_return parameterValue() // throws RecognitionException [1]
    {   
        LPMEDParser.parameterValue_return retval = new LPMEDParser.parameterValue_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        IToken ID142 = null;
        IToken INT143 = null;
        LPMEDParser.qualifiedName_return qualifiedName144 = default(LPMEDParser.qualifiedName_return);


        CommonTree ID142_tree=null;
        CommonTree INT143_tree=null;
        RewriteRuleTokenStream stream_INT = new RewriteRuleTokenStream(adaptor,"token INT");
        RewriteRuleTokenStream stream_ID = new RewriteRuleTokenStream(adaptor,"token ID");
        RewriteRuleSubtreeStream stream_qualifiedName = new RewriteRuleSubtreeStream(adaptor,"rule qualifiedName");
        try 
    	{
            // LPMEDParser.g:175:16: ( ID -> ID | INT -> INT | qualifiedName -> qualifiedName )
            int alt23 = 3;
            int LA23_0 = input.LA(1);

            if ( (LA23_0 == ID) )
            {
                int LA23_1 = input.LA(2);

                if ( (LA23_1 == CBRACKET || LA23_1 == COMMA) )
                {
                    alt23 = 1;
                }
                else if ( (LA23_1 == DOT) )
                {
                    alt23 = 3;
                }
                else 
                {
                    if ( state.backtracking > 0 ) {state.failed = true; return retval;}
                    NoViableAltException nvae_d23s1 =
                        new NoViableAltException("", 23, 1, input);

                    throw nvae_d23s1;
                }
            }
            else if ( (LA23_0 == INT) )
            {
                alt23 = 2;
            }
            else 
            {
                if ( state.backtracking > 0 ) {state.failed = true; return retval;}
                NoViableAltException nvae_d23s0 =
                    new NoViableAltException("", 23, 0, input);

                throw nvae_d23s0;
            }
            switch (alt23) 
            {
                case 1 :
                    // LPMEDParser.g:176:3: ID
                    {
                    	ID142=(IToken)Match(input,ID,FOLLOW_ID_in_parameterValue1358); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_ID.Add(ID142);



                    	// AST REWRITE
                    	// elements:          ID
                    	// token labels:      
                    	// rule labels:       retval
                    	// token list labels: 
                    	// rule list labels:  
                    	if ( state.backtracking==0 ) {
                    	retval.Tree = root_0;
                    	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

                    	root_0 = (CommonTree)adaptor.GetNilNode();
                    	// 176:8: -> ID
                    	{
                    	    adaptor.AddChild(root_0, stream_ID.NextNode());

                    	}

                    	retval.Tree = root_0;retval.Tree = root_0;}
                    }
                    break;
                case 2 :
                    // LPMEDParser.g:177:4: INT
                    {
                    	INT143=(IToken)Match(input,INT,FOLLOW_INT_in_parameterValue1369); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_INT.Add(INT143);



                    	// AST REWRITE
                    	// elements:          INT
                    	// token labels:      
                    	// rule labels:       retval
                    	// token list labels: 
                    	// rule list labels:  
                    	if ( state.backtracking==0 ) {
                    	retval.Tree = root_0;
                    	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

                    	root_0 = (CommonTree)adaptor.GetNilNode();
                    	// 177:9: -> INT
                    	{
                    	    adaptor.AddChild(root_0, stream_INT.NextNode());

                    	}

                    	retval.Tree = root_0;retval.Tree = root_0;}
                    }
                    break;
                case 3 :
                    // LPMEDParser.g:178:4: qualifiedName
                    {
                    	PushFollow(FOLLOW_qualifiedName_in_parameterValue1379);
                    	qualifiedName144 = qualifiedName();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) stream_qualifiedName.Add(qualifiedName144.Tree);


                    	// AST REWRITE
                    	// elements:          qualifiedName
                    	// token labels:      
                    	// rule labels:       retval
                    	// token list labels: 
                    	// rule list labels:  
                    	if ( state.backtracking==0 ) {
                    	retval.Tree = root_0;
                    	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

                    	root_0 = (CommonTree)adaptor.GetNilNode();
                    	// 178:18: -> qualifiedName
                    	{
                    	    adaptor.AddChild(root_0, stream_qualifiedName.NextTree());

                    	}

                    	retval.Tree = root_0;retval.Tree = root_0;}
                    }
                    break;

            }
            retval.Stop = input.LT(-1);

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);}
        }
        catch (Exception e) 
        {
            Logger.Add(e); if (e is RecognitionException) Recover(input,(RecognitionException)e);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "parameterValue"

    public class functionDefinition_return : ParserRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "functionDefinition"
    // LPMEDParser.g:183:1: functionDefinition : DEFUN name= ID OBRACKET CBRACKET CURLYOBRACKET body= functionBody CURLYCBRACKET ;
    public LPMEDParser.functionDefinition_return functionDefinition() // throws RecognitionException [1]
    {   
        LPMEDParser.functionDefinition_return retval = new LPMEDParser.functionDefinition_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        IToken name = null;
        IToken DEFUN145 = null;
        IToken OBRACKET146 = null;
        IToken CBRACKET147 = null;
        IToken CURLYOBRACKET148 = null;
        IToken CURLYCBRACKET149 = null;
        LPMEDParser.functionBody_return body = default(LPMEDParser.functionBody_return);


        CommonTree name_tree=null;
        CommonTree DEFUN145_tree=null;
        CommonTree OBRACKET146_tree=null;
        CommonTree CBRACKET147_tree=null;
        CommonTree CURLYOBRACKET148_tree=null;
        CommonTree CURLYCBRACKET149_tree=null;

        try 
    	{
            // LPMEDParser.g:183:20: ( DEFUN name= ID OBRACKET CBRACKET CURLYOBRACKET body= functionBody CURLYCBRACKET )
            // LPMEDParser.g:184:3: DEFUN name= ID OBRACKET CBRACKET CURLYOBRACKET body= functionBody CURLYCBRACKET
            {
            	root_0 = (CommonTree)adaptor.GetNilNode();

            	DEFUN145=(IToken)Match(input,DEFUN,FOLLOW_DEFUN_in_functionDefinition1401); if (state.failed) return retval;
            	if ( state.backtracking == 0 )
            	{DEFUN145_tree = (CommonTree)adaptor.Create(DEFUN145);
            		adaptor.AddChild(root_0, DEFUN145_tree);
            	}
            	name=(IToken)Match(input,ID,FOLLOW_ID_in_functionDefinition1407); if (state.failed) return retval;
            	if ( state.backtracking == 0 )
            	{name_tree = (CommonTree)adaptor.Create(name);
            		adaptor.AddChild(root_0, name_tree);
            	}
            	OBRACKET146=(IToken)Match(input,OBRACKET,FOLLOW_OBRACKET_in_functionDefinition1409); if (state.failed) return retval;
            	if ( state.backtracking == 0 )
            	{OBRACKET146_tree = (CommonTree)adaptor.Create(OBRACKET146);
            		adaptor.AddChild(root_0, OBRACKET146_tree);
            	}
            	CBRACKET147=(IToken)Match(input,CBRACKET,FOLLOW_CBRACKET_in_functionDefinition1411); if (state.failed) return retval;
            	if ( state.backtracking == 0 )
            	{CBRACKET147_tree = (CommonTree)adaptor.Create(CBRACKET147);
            		adaptor.AddChild(root_0, CBRACKET147_tree);
            	}
            	CURLYOBRACKET148=(IToken)Match(input,CURLYOBRACKET,FOLLOW_CURLYOBRACKET_in_functionDefinition1413); if (state.failed) return retval;
            	if ( state.backtracking == 0 )
            	{CURLYOBRACKET148_tree = (CommonTree)adaptor.Create(CURLYOBRACKET148);
            		adaptor.AddChild(root_0, CURLYOBRACKET148_tree);
            	}
            	if ( state.backtracking == 0 ) 
            	{
            	  functionNesting++;
            	}
            	PushFollow(FOLLOW_functionBody_in_functionDefinition1421);
            	body = functionBody();
            	state.followingStackPointer--;
            	if (state.failed) return retval;
            	if ( state.backtracking == 0 ) adaptor.AddChild(root_0, body.Tree);
            	CURLYCBRACKET149=(IToken)Match(input,CURLYCBRACKET,FOLLOW_CURLYCBRACKET_in_functionDefinition1423); if (state.failed) return retval;
            	if ( state.backtracking == 0 )
            	{CURLYCBRACKET149_tree = (CommonTree)adaptor.Create(CURLYCBRACKET149);
            		adaptor.AddChild(root_0, CURLYCBRACKET149_tree);
            	}
            	if ( state.backtracking == 0 ) 
            	{

            	  	functionNesting--;
            	          if ((functionManager != null) && (functionNesting == 0))
            	              Logger.AddRange(functionManager.DefineFunction(name, ((body != null) ? input.ToString((IToken)(body.Start),(IToken)(body.Stop)) : null)));
            	      
            	}

            }

            retval.Stop = input.LT(-1);

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);}
        }
        catch (Exception e) 
        {
            Logger.Add(e); if (e is RecognitionException) Recover(input,(RecognitionException)e);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "functionDefinition"

    public class functionBody_return : ParserRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "functionBody"
    // LPMEDParser.g:193:1: functionBody : ( stmt | varDecListFree )* ;
    public LPMEDParser.functionBody_return functionBody() // throws RecognitionException [1]
    {   
        LPMEDParser.functionBody_return retval = new LPMEDParser.functionBody_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        LPMEDParser.stmt_return stmt150 = default(LPMEDParser.stmt_return);

        LPMEDParser.varDecListFree_return varDecListFree151 = default(LPMEDParser.varDecListFree_return);



        try 
    	{
            // LPMEDParser.g:193:14: ( ( stmt | varDecListFree )* )
            // LPMEDParser.g:194:4: ( stmt | varDecListFree )*
            {
            	root_0 = (CommonTree)adaptor.GetNilNode();

            	// LPMEDParser.g:194:4: ( stmt | varDecListFree )*
            	do 
            	{
            	    int alt24 = 3;
            	    int LA24_0 = input.LA(1);

            	    if ( (LA24_0 == TERMINATEALL || LA24_0 == IF || (LA24_0 >= FOR && LA24_0 <= WHILE) || (LA24_0 >= BREAKPOINT && LA24_0 <= DEFUN) || LA24_0 == ID || LA24_0 == CURLYOBRACKET) )
            	    {
            	        alt24 = 1;
            	    }
            	    else if ( (LA24_0 == VAR) )
            	    {
            	        alt24 = 2;
            	    }


            	    switch (alt24) 
            		{
            			case 1 :
            			    // LPMEDParser.g:194:5: stmt
            			    {
            			    	PushFollow(FOLLOW_stmt_in_functionBody1448);
            			    	stmt150 = stmt();
            			    	state.followingStackPointer--;
            			    	if (state.failed) return retval;
            			    	if ( state.backtracking == 0 ) adaptor.AddChild(root_0, stmt150.Tree);

            			    }
            			    break;
            			case 2 :
            			    // LPMEDParser.g:194:12: varDecListFree
            			    {
            			    	PushFollow(FOLLOW_varDecListFree_in_functionBody1452);
            			    	varDecListFree151 = varDecListFree();
            			    	state.followingStackPointer--;
            			    	if (state.failed) return retval;
            			    	if ( state.backtracking == 0 ) adaptor.AddChild(root_0, varDecListFree151.Tree);

            			    }
            			    break;

            			default:
            			    goto loop24;
            	    }
            	} while (true);

            	loop24:
            		;	// Stops C# compiler whining that label 'loop24' has no statements


            }

            retval.Stop = input.LT(-1);

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);}
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
    	// Conversion of the second argument necessary, but harmless
    	retval.Tree = (CommonTree)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "functionBody"

    // $ANTLR start "synpred1_LPMEDParser"
    public void synpred1_LPMEDParser_fragment() {
        LPMEDParser.blockStmt_return th = default(LPMEDParser.blockStmt_return);

        LPMEDParser.blockStmt_return el = default(LPMEDParser.blockStmt_return);


        // LPMEDParser.g:70:4: ( IF OBRACKET expr CBRACKET THEN th= blockStmt ELSE el= blockStmt )
        // LPMEDParser.g:70:4: IF OBRACKET expr CBRACKET THEN th= blockStmt ELSE el= blockStmt
        {
        	Match(input,IF,FOLLOW_IF_in_synpred1_LPMEDParser433); if (state.failed) return ;
        	Match(input,OBRACKET,FOLLOW_OBRACKET_in_synpred1_LPMEDParser435); if (state.failed) return ;
        	PushFollow(FOLLOW_expr_in_synpred1_LPMEDParser437);
        	expr();
        	state.followingStackPointer--;
        	if (state.failed) return ;
        	Match(input,CBRACKET,FOLLOW_CBRACKET_in_synpred1_LPMEDParser439); if (state.failed) return ;
        	Match(input,THEN,FOLLOW_THEN_in_synpred1_LPMEDParser441); if (state.failed) return ;
        	PushFollow(FOLLOW_blockStmt_in_synpred1_LPMEDParser445);
        	th = blockStmt();
        	state.followingStackPointer--;
        	if (state.failed) return ;
        	Match(input,ELSE,FOLLOW_ELSE_in_synpred1_LPMEDParser447); if (state.failed) return ;
        	PushFollow(FOLLOW_blockStmt_in_synpred1_LPMEDParser451);
        	el = blockStmt();
        	state.followingStackPointer--;
        	if (state.failed) return ;

        }
    }
    // $ANTLR end "synpred1_LPMEDParser"

    // Delegated rules

   	public bool synpred1_LPMEDParser() 
   	{
   	    state.backtracking++;
   	    int start = input.Mark();
   	    try 
   	    {
   	        synpred1_LPMEDParser_fragment(); // can never throw exception
   	    }
   	    catch (RecognitionException re) 
   	    {
   	        Console.Error.WriteLine("impossible: "+re);
   	    }
   	    bool success = !state.failed;
   	    input.Rewind(start);
   	    state.backtracking--;
   	    state.failed = false;
   	    return success;
   	}


   	protected DFA6 dfa6;
   	protected DFA17 dfa17;
   	protected DFA19 dfa19;
   	protected DFA20 dfa20;
	private void InitializeCyclicDFAs()
	{
    	this.dfa6 = new DFA6(this);
    	this.dfa17 = new DFA17(this);
    	this.dfa19 = new DFA19(this);
    	this.dfa20 = new DFA20(this);




	}

    const string DFA6_eotS =
        "\x0c\uffff";
    const string DFA6_eofS =
        "\x0c\uffff";
    const string DFA6_minS =
        "\x01\x27\x01\x47\x0a\uffff";
    const string DFA6_maxS =
        "\x01\x49\x01\x4c\x0a\uffff";
    const string DFA6_acceptS =
        "\x02\uffff\x01\x02\x01\x03\x01\x04\x01\x06\x01\x07\x01\x08\x01"+
        "\x0a\x01\x01\x01\x05\x01\x09";
    const string DFA6_specialS =
        "\x0c\uffff}>";
    static readonly string[] DFA6_transitionS = {
            "\x01\x07\x10\uffff\x01\x02\x02\uffff\x01\x04\x01\x03\x04\uffff"+
            "\x01\x06\x01\x08\x03\uffff\x01\x01\x02\uffff\x01\x05",
            "\x01\x0b\x03\uffff\x01\x09\x01\x0a",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            ""
    };

    static readonly short[] DFA6_eot = DFA.UnpackEncodedString(DFA6_eotS);
    static readonly short[] DFA6_eof = DFA.UnpackEncodedString(DFA6_eofS);
    static readonly char[] DFA6_min = DFA.UnpackEncodedStringToUnsignedChars(DFA6_minS);
    static readonly char[] DFA6_max = DFA.UnpackEncodedStringToUnsignedChars(DFA6_maxS);
    static readonly short[] DFA6_accept = DFA.UnpackEncodedString(DFA6_acceptS);
    static readonly short[] DFA6_special = DFA.UnpackEncodedString(DFA6_specialS);
    static readonly short[][] DFA6_transition = DFA.UnpackEncodedStringArray(DFA6_transitionS);

    protected class DFA6 : DFA
    {
        public DFA6(BaseRecognizer recognizer)
        {
            this.recognizer = recognizer;
            this.decisionNumber = 6;
            this.eot = DFA6_eot;
            this.eof = DFA6_eof;
            this.min = DFA6_min;
            this.max = DFA6_max;
            this.accept = DFA6_accept;
            this.special = DFA6_special;
            this.transition = DFA6_transition;

        }

        override public string Description
        {
            get { return "51:1: stmt options {backtrack=false; } : ( assign SEMI -> assign | ifStmt | WHILE OBRACKET expr CBRACKET blockStmt -> ^( CWHILE expr blockStmt ) | FOR OBRACKET assign SEMI expr SEMI assign CBRACKET blockStmt -> ^( CFOR assign expr assign blockStmt ) | deviceMethodCall SEMI -> deviceMethodCall | blockStmt | BREAKPOINT OBRACKET INT CBRACKET SEMI -> ^( CBREAKPOINT INT ) | TERMINATEALL SEMI -> ^( CTERMINATEALL ) | functionCall SEMI -> functionCall | functionDefinition ->);"; }
        }

    }

    const string DFA17_eotS =
        "\x0c\uffff";
    const string DFA17_eofS =
        "\x0c\uffff";
    const string DFA17_minS =
        "\x01\x32\x01\x2b\x03\uffff\x01\x46\x01\uffff\x01\x4c\x01\x34\x01"+
        "\x2b\x02\uffff";
    const string DFA17_maxS =
        "\x01\x46\x01\x4d\x03\uffff\x01\x46\x01\uffff\x01\x4c\x01\x46\x01"+
        "\x4d\x02\uffff";
    const string DFA17_acceptS =
        "\x02\uffff\x01\x02\x01\x03\x01\x04\x01\uffff\x01\x01\x03\uffff"+
        "\x01\x06\x01\x05";
    const string DFA17_specialS =
        "\x0c\uffff}>";
    static readonly string[] DFA17_transitionS = {
            "\x01\x04\x03\uffff\x01\x03\x01\x02\x0e\uffff\x01\x01",
            "\x06\x06\x17\uffff\x01\x06\x03\uffff\x01\x05\x01\x06",
            "",
            "",
            "",
            "\x01\x07",
            "",
            "\x01\x08",
            "\x01\x0a\x11\uffff\x01\x09",
            "\x06\x0b\x17\uffff\x01\x0b\x03\uffff\x01\x08\x01\x0b",
            "",
            ""
    };

    static readonly short[] DFA17_eot = DFA.UnpackEncodedString(DFA17_eotS);
    static readonly short[] DFA17_eof = DFA.UnpackEncodedString(DFA17_eofS);
    static readonly char[] DFA17_min = DFA.UnpackEncodedStringToUnsignedChars(DFA17_minS);
    static readonly char[] DFA17_max = DFA.UnpackEncodedStringToUnsignedChars(DFA17_maxS);
    static readonly short[] DFA17_accept = DFA.UnpackEncodedString(DFA17_acceptS);
    static readonly short[] DFA17_special = DFA.UnpackEncodedString(DFA17_specialS);
    static readonly short[][] DFA17_transition = DFA.UnpackEncodedStringArray(DFA17_transitionS);

    protected class DFA17 : DFA
    {
        public DFA17(BaseRecognizer recognizer)
        {
            this.recognizer = recognizer;
            this.decisionNumber = 17;
            this.eot = DFA17_eot;
            this.eof = DFA17_eof;
            this.min = DFA17_min;
            this.max = DFA17_max;
            this.accept = DFA17_accept;
            this.special = DFA17_special;
            this.transition = DFA17_transition;

        }

        override public string Description
        {
            get { return "109:1: atom options {backtrack=true; } : ( ID -> ID | FLOAT -> ^( CFLOAT FLOAT ) | INT -> ^( CINT INT ) | DBOOL -> ^( CBOOL DBOOL ) | qualifiedName | name= ID ( DOT nodes+= ID )+ DOT STATE -> ^( CGETSTATE ^( OBJECTNAME $name) ^( NODES ( $nodes)* ) ) );"; }
        }

    }

    const string DFA19_eotS =
        "\x0e\uffff";
    const string DFA19_eofS =
        "\x0e\uffff";
    const string DFA19_minS =
        "\x01\x46\x01\x4c\x01\x46\x01\x47\x01\x3d\x03\uffff\x01\x47\x01"+
        "\uffff\x01\x3d\x03\uffff";
    const string DFA19_maxS =
        "\x01\x46\x01\x4c\x01\x46\x01\x4c\x01\x46\x03\uffff\x01\x4c\x01"+
        "\uffff\x01\x46\x03\uffff";
    const string DFA19_acceptS =
        "\x05\uffff\x01\x07\x01\x05\x01\x06\x01\uffff\x01\x04\x01\uffff"+
        "\x01\x02\x01\x03\x01\x01";
    const string DFA19_specialS =
        "\x0e\uffff}>";
    static readonly string[] DFA19_transitionS = {
            "\x01\x01",
            "\x01\x02",
            "\x01\x03",
            "\x01\x05\x04\uffff\x01\x04",
            "\x01\x07\x01\x06\x07\uffff\x01\x08",
            "",
            "",
            "",
            "\x01\x09\x04\uffff\x01\x0a",
            "",
            "\x01\x0b\x01\x0d\x01\x0c\x06\uffff\x01\x08",
            "",
            "",
            ""
    };

    static readonly short[] DFA19_eot = DFA.UnpackEncodedString(DFA19_eotS);
    static readonly short[] DFA19_eof = DFA.UnpackEncodedString(DFA19_eofS);
    static readonly char[] DFA19_min = DFA.UnpackEncodedStringToUnsignedChars(DFA19_minS);
    static readonly char[] DFA19_max = DFA.UnpackEncodedStringToUnsignedChars(DFA19_maxS);
    static readonly short[] DFA19_accept = DFA.UnpackEncodedString(DFA19_acceptS);
    static readonly short[] DFA19_special = DFA.UnpackEncodedString(DFA19_specialS);
    static readonly short[][] DFA19_transition = DFA.UnpackEncodedStringArray(DFA19_transitionS);

    protected class DFA19 : DFA
    {
        public DFA19(BaseRecognizer recognizer)
        {
            this.recognizer = recognizer;
            this.decisionNumber = 19;
            this.eot = DFA19_eot;
            this.eof = DFA19_eof;
            this.min = DFA19_min;
            this.max = DFA19_max;
            this.accept = DFA19_accept;
            this.special = DFA19_special;
            this.transition = DFA19_transition;

        }

        override public string Description
        {
            get { return "127:1: deviceMemberID : ( qualifiedName DOT GO -> ^( CASYNCCALL qualifiedName ) | qualifiedName DOT WAIT -> ^( CWAITTHECALL qualifiedName ) | qualifiedName DOT ENDPRESSURE -> ^( CENDTHECALL qualifiedName ) | qualifiedName -> ^( CSYNCCALL qualifiedName ) | name= ID DOT sm= ID DOT GO -> ^( CASYNCCALL ^( OBJECTNAME $name) ^( NODES ID ) ^( MEMBERNAME $sm) ) | name= ID DOT sm= ID DOT WAIT -> ^( CWAITTHECALL ^( OBJECTNAME $name) ^( NODES ID ) ^( MEMBERNAME $sm) ) | name= ID DOT sm= ID -> ^( CSYNCCALL ^( OBJECTNAME $name) ^( NODES ID ) ^( MEMBERNAME $sm) ) );"; }
        }

    }

    const string DFA20_eotS =
        "\x15\uffff";
    const string DFA20_eofS =
        "\x15\uffff";
    const string DFA20_minS =
        "\x01\x46\x01\x47\x01\x36\x02\x48\x01\x47\x01\x46\x01\x36\x01\x3d"+
        "\x01\uffff\x01\x4c\x02\x48\x02\uffff\x02\x46\x01\x48\x01\x4c\x01"+
        "\x46\x01\x48";
    const string DFA20_maxS =
        "\x01\x46\x01\x47\x01\x48\x02\x4f\x01\x4c\x02\x46\x01\x3e\x01\uffff"+
        "\x01\x4c\x02\x4f\x02\uffff\x02\x46\x01\x4f\x01\x4c\x01\x46\x01\x4f";
    const string DFA20_acceptS =
        "\x09\uffff\x01\x03\x03\uffff\x01\x01\x01\x02\x06\uffff";
    const string DFA20_specialS =
        "\x15\uffff}>";
    static readonly string[] DFA20_transitionS = {
            "\x01\x01",
            "\x01\x02",
            "\x01\x04\x0f\uffff\x01\x03\x01\uffff\x01\x05",
            "\x01\x05\x03\uffff\x01\x06\x02\uffff\x01\x07",
            "\x01\x05\x06\uffff\x01\x07",
            "\x01\x09\x04\uffff\x01\x08",
            "\x01\x0a",
            "\x01\x0c\x0f\uffff\x01\x0b",
            "\x01\x0e\x01\x0d",
            "",
            "\x01\x0f",
            "\x01\x05\x03\uffff\x01\x10\x02\uffff\x01\x07",
            "\x01\x05\x06\uffff\x01\x07",
            "",
            "",
            "\x01\x11",
            "\x01\x12",
            "\x01\x05\x03\uffff\x01\x0f\x02\uffff\x01\x07",
            "\x01\x13",
            "\x01\x14",
            "\x01\x05\x03\uffff\x01\x13\x02\uffff\x01\x07"
    };

    static readonly short[] DFA20_eot = DFA.UnpackEncodedString(DFA20_eotS);
    static readonly short[] DFA20_eof = DFA.UnpackEncodedString(DFA20_eofS);
    static readonly char[] DFA20_min = DFA.UnpackEncodedStringToUnsignedChars(DFA20_minS);
    static readonly char[] DFA20_max = DFA.UnpackEncodedStringToUnsignedChars(DFA20_maxS);
    static readonly short[] DFA20_accept = DFA.UnpackEncodedString(DFA20_acceptS);
    static readonly short[] DFA20_special = DFA.UnpackEncodedString(DFA20_specialS);
    static readonly short[][] DFA20_transition = DFA.UnpackEncodedStringArray(DFA20_transitionS);

    protected class DFA20 : DFA
    {
        public DFA20(BaseRecognizer recognizer)
        {
            this.recognizer = recognizer;
            this.decisionNumber = 20;
            this.eot = DFA20_eot;
            this.eof = DFA20_eof;
            this.min = DFA20_min;
            this.max = DFA20_max;
            this.accept = DFA20_accept;
            this.special = DFA20_special;
            this.transition = DFA20_transition;

        }

        override public string Description
        {
            get { return "149:1: functionCall : ( functionSignature DOT GO OBRACKET CBRACKET -> ^( CASYNCFUNCCALL functionSignature ) | functionSignature DOT WAIT OBRACKET CBRACKET -> ^( CWAITFUNCFINISH functionSignature ) | functionSignature OBRACKET CBRACKET -> ^( CSYNCFUNCCALL functionSignature ) );"; }
        }

    }

 

    public static readonly BitSet FOLLOW_varDecListFixed_in_block70 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000201UL});
    public static readonly BitSet FOLLOW_blockStmt_in_block74 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_VAR_in_varDecListFixed88 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000040UL});
    public static readonly BitSet FOLLOW_varDecListAtom_in_varDecListFixed91 = new BitSet(new ulong[]{0x0000000000000002UL,0x0000000000000040UL});
    public static readonly BitSet FOLLOW_VAR_in_varDecListFree113 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000040UL});
    public static readonly BitSet FOLLOW_ID_in_varDecListFree116 = new BitSet(new ulong[]{0x0000000000000000UL,0x000000000000C000UL});
    public static readonly BitSet FOLLOW_COMMA_in_varDecListFree119 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000040UL});
    public static readonly BitSet FOLLOW_ID_in_varDecListFree121 = new BitSet(new ulong[]{0x0000000000000000UL,0x000000000000C000UL});
    public static readonly BitSet FOLLOW_COLON_in_varDecListFree126 = new BitSet(new ulong[]{0x0002000000000000UL});
    public static readonly BitSet FOLLOW_TYPE_in_varDecListFree128 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000002000UL});
    public static readonly BitSet FOLLOW_SEMI_in_varDecListFree130 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_peremDecList_in_varDecListAtom157 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000004000UL});
    public static readonly BitSet FOLLOW_COLON_in_varDecListAtom159 = new BitSet(new ulong[]{0x0002000000000000UL});
    public static readonly BitSet FOLLOW_TYPE_in_varDecListAtom161 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000002000UL});
    public static readonly BitSet FOLLOW_SEMI_in_varDecListAtom163 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_ID_in_peremDecList190 = new BitSet(new ulong[]{0x0000000000000002UL,0x0000000000008000UL});
    public static readonly BitSet FOLLOW_COMMA_in_peremDecList193 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000040UL});
    public static readonly BitSet FOLLOW_ID_in_peremDecList195 = new BitSet(new ulong[]{0x0000000000000002UL,0x0000000000008000UL});
    public static readonly BitSet FOLLOW_CURLYOBRACKET_in_blockStmt216 = new BitSet(new ulong[]{0x1900008000000000UL,0x0000000000000646UL});
    public static readonly BitSet FOLLOW_stmt_in_blockStmt219 = new BitSet(new ulong[]{0x1900008000000000UL,0x0000000000000646UL});
    public static readonly BitSet FOLLOW_CURLYCBRACKET_in_blockStmt223 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_assign_in_stmt257 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000002000UL});
    public static readonly BitSet FOLLOW_SEMI_in_stmt259 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_ifStmt_in_stmt269 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_WHILE_in_stmt275 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000080UL});
    public static readonly BitSet FOLLOW_OBRACKET_in_stmt277 = new BitSet(new ulong[]{0x00C4040000000000UL,0x00000000000000C0UL});
    public static readonly BitSet FOLLOW_expr_in_stmt279 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000100UL});
    public static readonly BitSet FOLLOW_CBRACKET_in_stmt281 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000200UL});
    public static readonly BitSet FOLLOW_blockStmt_in_stmt283 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_FOR_in_stmt299 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000080UL});
    public static readonly BitSet FOLLOW_OBRACKET_in_stmt301 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000040UL});
    public static readonly BitSet FOLLOW_assign_in_stmt303 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000002000UL});
    public static readonly BitSet FOLLOW_SEMI_in_stmt305 = new BitSet(new ulong[]{0x00C4040000000000UL,0x00000000000000C0UL});
    public static readonly BitSet FOLLOW_expr_in_stmt307 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000002000UL});
    public static readonly BitSet FOLLOW_SEMI_in_stmt309 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000040UL});
    public static readonly BitSet FOLLOW_assign_in_stmt311 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000100UL});
    public static readonly BitSet FOLLOW_CBRACKET_in_stmt313 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000200UL});
    public static readonly BitSet FOLLOW_blockStmt_in_stmt315 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_deviceMethodCall_in_stmt335 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000002000UL});
    public static readonly BitSet FOLLOW_SEMI_in_stmt337 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_blockStmt_in_stmt347 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_BREAKPOINT_in_stmt353 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000080UL});
    public static readonly BitSet FOLLOW_OBRACKET_in_stmt355 = new BitSet(new ulong[]{0x0040000000000000UL});
    public static readonly BitSet FOLLOW_INT_in_stmt357 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000100UL});
    public static readonly BitSet FOLLOW_CBRACKET_in_stmt359 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000002000UL});
    public static readonly BitSet FOLLOW_SEMI_in_stmt361 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_TERMINATEALL_in_stmt375 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000002000UL});
    public static readonly BitSet FOLLOW_SEMI_in_stmt377 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_functionCall_in_stmt389 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000002000UL});
    public static readonly BitSet FOLLOW_SEMI_in_stmt391 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_functionDefinition_in_stmt401 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_IF_in_ifStmt433 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000080UL});
    public static readonly BitSet FOLLOW_OBRACKET_in_ifStmt435 = new BitSet(new ulong[]{0x00C4040000000000UL,0x00000000000000C0UL});
    public static readonly BitSet FOLLOW_expr_in_ifStmt437 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000100UL});
    public static readonly BitSet FOLLOW_CBRACKET_in_ifStmt439 = new BitSet(new ulong[]{0x0200000000000000UL});
    public static readonly BitSet FOLLOW_THEN_in_ifStmt441 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000200UL});
    public static readonly BitSet FOLLOW_blockStmt_in_ifStmt445 = new BitSet(new ulong[]{0x0400000000000000UL});
    public static readonly BitSet FOLLOW_ELSE_in_ifStmt447 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000200UL});
    public static readonly BitSet FOLLOW_blockStmt_in_ifStmt451 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_IF_in_ifStmt471 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000080UL});
    public static readonly BitSet FOLLOW_OBRACKET_in_ifStmt473 = new BitSet(new ulong[]{0x00C4040000000000UL,0x00000000000000C0UL});
    public static readonly BitSet FOLLOW_expr_in_ifStmt475 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000100UL});
    public static readonly BitSet FOLLOW_CBRACKET_in_ifStmt477 = new BitSet(new ulong[]{0x0200000000000000UL});
    public static readonly BitSet FOLLOW_THEN_in_ifStmt479 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000200UL});
    public static readonly BitSet FOLLOW_blockStmt_in_ifStmt481 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_ID_in_assign510 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000800UL});
    public static readonly BitSet FOLLOW_EQUALS_in_assign512 = new BitSet(new ulong[]{0x00C4040000000000UL,0x00000000000000C0UL});
    public static readonly BitSet FOLLOW_expr_in_assign514 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_orExpr_in_expr543 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_andExpr_in_orExpr553 = new BitSet(new ulong[]{0x0001000000000002UL});
    public static readonly BitSet FOLLOW_OpOr_in_orExpr556 = new BitSet(new ulong[]{0x00C4040000000000UL,0x00000000000000C0UL});
    public static readonly BitSet FOLLOW_andExpr_in_orExpr559 = new BitSet(new ulong[]{0x0001000000000002UL});
    public static readonly BitSet FOLLOW_equalityExpr_in_andExpr570 = new BitSet(new ulong[]{0x0000800000000002UL});
    public static readonly BitSet FOLLOW_OpAnd_in_andExpr573 = new BitSet(new ulong[]{0x00C4040000000000UL,0x00000000000000C0UL});
    public static readonly BitSet FOLLOW_equalityExpr_in_andExpr576 = new BitSet(new ulong[]{0x0000800000000002UL});
    public static readonly BitSet FOLLOW_comparisonExpr_in_equalityExpr587 = new BitSet(new ulong[]{0x0000400000000002UL});
    public static readonly BitSet FOLLOW_OpLogicalB_in_equalityExpr590 = new BitSet(new ulong[]{0x00C4040000000000UL,0x00000000000000C0UL});
    public static readonly BitSet FOLLOW_comparisonExpr_in_equalityExpr593 = new BitSet(new ulong[]{0x0000400000000002UL});
    public static readonly BitSet FOLLOW_additiveExpr_in_comparisonExpr604 = new BitSet(new ulong[]{0x0000200000000002UL});
    public static readonly BitSet FOLLOW_OpLogicalA_in_comparisonExpr607 = new BitSet(new ulong[]{0x00C4040000000000UL,0x00000000000000C0UL});
    public static readonly BitSet FOLLOW_additiveExpr_in_comparisonExpr610 = new BitSet(new ulong[]{0x0000200000000002UL});
    public static readonly BitSet FOLLOW_multiplicativeExpr_in_additiveExpr621 = new BitSet(new ulong[]{0x0000100000000002UL});
    public static readonly BitSet FOLLOW_OpAddSub_in_additiveExpr624 = new BitSet(new ulong[]{0x00C4040000000000UL,0x00000000000000C0UL});
    public static readonly BitSet FOLLOW_multiplicativeExpr_in_additiveExpr627 = new BitSet(new ulong[]{0x0000100000000002UL});
    public static readonly BitSet FOLLOW_notExpr_in_multiplicativeExpr637 = new BitSet(new ulong[]{0x0000080000000002UL});
    public static readonly BitSet FOLLOW_OpDivMul_in_multiplicativeExpr640 = new BitSet(new ulong[]{0x00C4040000000000UL,0x00000000000000C0UL});
    public static readonly BitSet FOLLOW_notExpr_in_multiplicativeExpr643 = new BitSet(new ulong[]{0x0000080000000002UL});
    public static readonly BitSet FOLLOW_OpUnar_in_notExpr659 = new BitSet(new ulong[]{0x00C4040000000000UL,0x00000000000000C0UL});
    public static readonly BitSet FOLLOW_primary_in_notExpr662 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_primary_in_notExpr670 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_atom_in_primary698 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_OBRACKET_in_primary705 = new BitSet(new ulong[]{0x00C4040000000000UL,0x00000000000000C0UL});
    public static readonly BitSet FOLLOW_expr_in_primary707 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000100UL});
    public static readonly BitSet FOLLOW_CBRACKET_in_primary709 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_ID_in_atom744 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_FLOAT_in_atom753 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_INT_in_atom767 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_DBOOL_in_atom780 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_qualifiedName_in_atom793 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_ID_in_atom800 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000001000UL});
    public static readonly BitSet FOLLOW_DOT_in_atom803 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000040UL});
    public static readonly BitSet FOLLOW_ID_in_atom807 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000001000UL});
    public static readonly BitSet FOLLOW_DOT_in_atom812 = new BitSet(new ulong[]{0x0010000000000000UL});
    public static readonly BitSet FOLLOW_STATE_in_atom814 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_ID_in_qualifiedName853 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000001000UL});
    public static readonly BitSet FOLLOW_DOT_in_qualifiedName856 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000040UL});
    public static readonly BitSet FOLLOW_ID_in_qualifiedName860 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000001000UL});
    public static readonly BitSet FOLLOW_DOT_in_qualifiedName865 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000040UL});
    public static readonly BitSet FOLLOW_ID_in_qualifiedName869 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_qualifiedName_in_deviceMemberID908 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000001000UL});
    public static readonly BitSet FOLLOW_DOT_in_deviceMemberID910 = new BitSet(new ulong[]{0x4000000000000000UL});
    public static readonly BitSet FOLLOW_GO_in_deviceMemberID912 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_qualifiedName_in_deviceMemberID932 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000001000UL});
    public static readonly BitSet FOLLOW_DOT_in_deviceMemberID934 = new BitSet(new ulong[]{0x2000000000000000UL});
    public static readonly BitSet FOLLOW_WAIT_in_deviceMemberID936 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_qualifiedName_in_deviceMemberID954 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000001000UL});
    public static readonly BitSet FOLLOW_DOT_in_deviceMemberID956 = new BitSet(new ulong[]{0x8000000000000000UL});
    public static readonly BitSet FOLLOW_ENDPRESSURE_in_deviceMemberID958 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_qualifiedName_in_deviceMemberID977 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_ID_in_deviceMemberID997 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000001000UL});
    public static readonly BitSet FOLLOW_DOT_in_deviceMemberID999 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000040UL});
    public static readonly BitSet FOLLOW_ID_in_deviceMemberID1003 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000001000UL});
    public static readonly BitSet FOLLOW_DOT_in_deviceMemberID1005 = new BitSet(new ulong[]{0x4000000000000000UL});
    public static readonly BitSet FOLLOW_GO_in_deviceMemberID1007 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_ID_in_deviceMemberID1047 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000001000UL});
    public static readonly BitSet FOLLOW_DOT_in_deviceMemberID1049 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000040UL});
    public static readonly BitSet FOLLOW_ID_in_deviceMemberID1053 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000001000UL});
    public static readonly BitSet FOLLOW_DOT_in_deviceMemberID1055 = new BitSet(new ulong[]{0x2000000000000000UL});
    public static readonly BitSet FOLLOW_WAIT_in_deviceMemberID1057 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_ID_in_deviceMemberID1096 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000001000UL});
    public static readonly BitSet FOLLOW_DOT_in_deviceMemberID1098 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000040UL});
    public static readonly BitSet FOLLOW_ID_in_deviceMemberID1102 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_deviceMemberID_in_deviceMethodCall1150 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000080UL});
    public static readonly BitSet FOLLOW_OBRACKET_in_deviceMethodCall1152 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000100UL});
    public static readonly BitSet FOLLOW_CBRACKET_in_deviceMethodCall1154 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_functionSignature_in_functionCall1181 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000001000UL});
    public static readonly BitSet FOLLOW_DOT_in_functionCall1183 = new BitSet(new ulong[]{0x4000000000000000UL});
    public static readonly BitSet FOLLOW_GO_in_functionCall1185 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000080UL});
    public static readonly BitSet FOLLOW_OBRACKET_in_functionCall1187 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000100UL});
    public static readonly BitSet FOLLOW_CBRACKET_in_functionCall1189 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_functionSignature_in_functionCall1208 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000001000UL});
    public static readonly BitSet FOLLOW_DOT_in_functionCall1210 = new BitSet(new ulong[]{0x2000000000000000UL});
    public static readonly BitSet FOLLOW_WAIT_in_functionCall1212 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000080UL});
    public static readonly BitSet FOLLOW_OBRACKET_in_functionCall1214 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000100UL});
    public static readonly BitSet FOLLOW_CBRACKET_in_functionCall1216 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_functionSignature_in_functionCall1234 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000080UL});
    public static readonly BitSet FOLLOW_OBRACKET_in_functionCall1236 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000100UL});
    public static readonly BitSet FOLLOW_CBRACKET_in_functionCall1238 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_ID_in_functionSignature1268 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000080UL});
    public static readonly BitSet FOLLOW_OBRACKET_in_functionSignature1270 = new BitSet(new ulong[]{0x0040000000000000UL,0x0000000000000140UL});
    public static readonly BitSet FOLLOW_parameterList_in_functionSignature1272 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000100UL});
    public static readonly BitSet FOLLOW_CBRACKET_in_functionSignature1275 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_parameter_in_parameterList1301 = new BitSet(new ulong[]{0x0000000000000002UL,0x0000000000008000UL});
    public static readonly BitSet FOLLOW_COMMA_in_parameterList1304 = new BitSet(new ulong[]{0x0040000000000000UL,0x0000000000000040UL});
    public static readonly BitSet FOLLOW_parameter_in_parameterList1308 = new BitSet(new ulong[]{0x0000000000000002UL,0x0000000000008000UL});
    public static readonly BitSet FOLLOW_parameterValue_in_parameter1333 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_ID_in_parameterValue1358 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_INT_in_parameterValue1369 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_qualifiedName_in_parameterValue1379 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_DEFUN_in_functionDefinition1401 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000040UL});
    public static readonly BitSet FOLLOW_ID_in_functionDefinition1407 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000080UL});
    public static readonly BitSet FOLLOW_OBRACKET_in_functionDefinition1409 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000100UL});
    public static readonly BitSet FOLLOW_CBRACKET_in_functionDefinition1411 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000200UL});
    public static readonly BitSet FOLLOW_CURLYOBRACKET_in_functionDefinition1413 = new BitSet(new ulong[]{0x1900008000000000UL,0x0000000000000647UL});
    public static readonly BitSet FOLLOW_functionBody_in_functionDefinition1421 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000400UL});
    public static readonly BitSet FOLLOW_CURLYCBRACKET_in_functionDefinition1423 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_stmt_in_functionBody1448 = new BitSet(new ulong[]{0x1900008000000002UL,0x0000000000000247UL});
    public static readonly BitSet FOLLOW_varDecListFree_in_functionBody1452 = new BitSet(new ulong[]{0x1900008000000002UL,0x0000000000000247UL});
    public static readonly BitSet FOLLOW_IF_in_synpred1_LPMEDParser433 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000080UL});
    public static readonly BitSet FOLLOW_OBRACKET_in_synpred1_LPMEDParser435 = new BitSet(new ulong[]{0x00C4040000000000UL,0x00000000000000C0UL});
    public static readonly BitSet FOLLOW_expr_in_synpred1_LPMEDParser437 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000100UL});
    public static readonly BitSet FOLLOW_CBRACKET_in_synpred1_LPMEDParser439 = new BitSet(new ulong[]{0x0200000000000000UL});
    public static readonly BitSet FOLLOW_THEN_in_synpred1_LPMEDParser441 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000200UL});
    public static readonly BitSet FOLLOW_blockStmt_in_synpred1_LPMEDParser445 = new BitSet(new ulong[]{0x0400000000000000UL});
    public static readonly BitSet FOLLOW_ELSE_in_synpred1_LPMEDParser447 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000200UL});
    public static readonly BitSet FOLLOW_blockStmt_in_synpred1_LPMEDParser451 = new BitSet(new ulong[]{0x0000000000000002UL});

}
}